Git Product home page Git Product logo

robotframework-sikulilibrary's People

Contributors

gigi199596 avatar jonsnow1337 avatar jpeltonen avatar lethall avatar lucielavickova-tesena avatar pierre6677 avatar rainmanwy avatar rbosse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robotframework-sikulilibrary's Issues

[brainstorming]: "Take screenshot if Screen Should Contain fails"

Use Case

i'm searching for "image" in "page".

the check fail.

why?

recording a screenshot can be useful.

i create this keyword

Page Should Contain This Or Take Screenshot If Not Contain
	[Arguments]					${WHAT}
	${passed} =					Run Keyword And Return Status		Screen Should Contain		${WHAT}
	Log To Console				${passed}
	Run Keyword Unless			${passed}					Capture Page Screenshot			searching_${WHAT}.png	

so

  1. i store the result of Screen Should Contain
  2. if Screen Should Contain returns true, do nothing
  3. if Screen Should Contain returns False, Capture Page Screenshot

this approach can be useful for other tester?

maybe we can another parameter to Screen Should Contain with the name of the screenshot to create if the check fails?

it can be useful to understand WHY a check is failing.

what do you think @rainmanwy ?

Different browsers different Colors. How to handle this situation?

This is my situation

Same website
Screenshot taken with Windows Snipping Tools
Every test use "Page Should Contain" screenshot on the screen.

If screenshot are taken viewing website with chrome and test are runned with chrome, everything works as aspected. Same in Firefox. But if i use firefox to search screenshot taken with chrome, image recognition fail.

I understand that different browser renders colour in a little different way. In my case, grey color is a bit darker in Firefox.

To avoid this situation, i think i can Set Min Similarity a bit lover, but i prefer to avoid this approach to avoid false positive recognition.

Any suggestion?

thanks.

[Errno 61] Connection refused - on Mac

Hi,
I'm trying to run sikuli on Mac slaves (I have it working on windows slaves), but am getting connection refused error!

############### Running Test Suite: iOS_StreamVideo - Darwin 15.6.0 (PAs-Mac.local) ###############
[ WARN ] Imported library '/Users/padmin/Documents/workspace/PeerApp_Automation/resources/sql.py' contains no keywords.
[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:49706/ failed: [Errno 61] Connection refused
[ ERROR ] Error in file '/Users/padmin/Documents/workspace//Keywords/iOS_StreamVideo_Keywords.txt': Initializing test library 'SikuliLibrary' with no arguments failed: Failed to get_keyword_names!
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 41, in init
self.remote = self._connect_remote_library()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 138, in _connect_remote_library
self._test_get_keyword_names(remote)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 155, in _test_get_keyword_names
raise RuntimeError('Failed to get_keyword_names!')

The error of no arguments is not the real cause, even after giving it (despite I didn't need to do it in windows) am still getting:

[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:49758/ failed: [Errno 61] Connection refused
[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:49758/ failed: [Errno 61] Connection refused
[ ERROR ] Error in file '/Users/padmin/Documents/workspace//Keywords/iOS_StreamVideo_Keywords.txt': Initializing test library 'SikuliLibrary' with no arguments failed: Failed to get_keyword_names!
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 41, in init
self.remote = self._connect_remote_library()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 138, in _connect_remote_library
self._test_get_keyword_names(remote)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 155, in _test_get_keyword_names
raise RuntimeError('Failed to get_keyword_names!')

Adding More Keywords

Hi Rainmanwy,

 I am looking into using your SikuliLibrary to do some automation on the Windows platform with Robot and possibly adding more Keywords to the ScreenKeywords.java file. What is the best way to go about doing it?

 I tried getting a fork from here and creating a new executable jar but it did not seem to work...

Thanks,
auyong

connection remote (localhost) server failed.

I create a very simple robot that runs on microsoft windows.

Now i need to create the same example in Linux Environment, ( linux mint )

I installed sikuli from maven and sikuli server can run if i manually run it, but robot framework is not able to connect to sikuli jar.

everything (robot framework, jar and sikuli library) runs on the same machine

if i run without super user permission i obtain :

[ ERROR ] Error in file '/home/qa-asus/Desktop/automatictestingtool/robotframework/THRON/Player/Customers/commons.robot': Initializing test library 'SikuliLibrary' with no arguments failed: Start sikuli java process failed!
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 40, in __init__
    self._start_sikuli_java_process()
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 97, in _start_sikuli_java_process
    self._wait_process_started()
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 114, in _wait_process_started
    raise RuntimeError('Start sikuli java process failed!')

if i run with super user permission i obtain

[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:42707/ failed: [Errno 111] Connection refused
[ ERROR ] Error in file '/home/qa-asus/Desktop/automatictestingtool/robotframework/THRON/Player/Customers/commons.robot': Initializing test library 'SikuliLibrary' with no arguments failed: Failed to get_keyword_names!
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 41, in __init__
    self.remote = self._connect_remote_library()
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 138, in _connect_remote_library
    self._test_get_keyword_names(remote)
  File "/usr/local/lib/python2.7/dist-packages/SikuliLibrary/sikuli.py", line 155, in _test_get_keyword_names
    raise RuntimeError('Failed to get_keyword_names!')

what should i do to permit connection?

thanks.

java command can fail in Windows with spaces between paths

def _start_sikuli_java_process(self):
        libFolder = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib')
        jarList = glob.glob(libFolder+os.sep+'*.jar')
        if len(jarList) != 1:
            raise Exception('Sikuli jar package should be exist in lib folder')
        sikuliJar = jarList[0]
        command = 'java -jar '+sikuliJar+' %s %s' % (str(self.port), self._get_output_folder())
        process = Process()
        process.start_process(command, shell=True, stdout=self._output_file(), stderr=self._err_file())
        self.logger.info('Start sikuli java process on port %s' % str(self.port))
        self._wait_process_started()
        self.logger.info('Sikuli java process is started')

sikuliJar can be on path that has empty spaces like C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\SikuliLibrary\lib\SikuliLibrary.jar

In Windows it should be command using double quotes around sikuliJar = 'java -jar '+'"' + sikuliJar + '"'+' %s %s' % (str(self.port), self._get_output_folder())

Don't know is it needed only in Windows and how to detect it.

A way to change Settings.MinSimilarity

Hi,
Great library but I've been having issues with "Screen Should Contain" giving out false positives.
I think if I could set Settings.MinSimilarity to about 0.9 that it would fix my issues.
Could you implement it or perhaps provide a workaround?

Thanks

Feature Request: Remove Image Path

I've figured out how you did it. You're using a collection of image paths to do this. I would like to request a Remove Image Path keyword that will either remove an image path from it's list, or throw an exception if the image path is not in the list.

This would assist when there are multiple files with similar names in different paths if the all get thrown into the path collection. We could remove them when we were done with them.

Thank you for your response.

If I were to run this keyword a second time in a script, what would happen?

Would it overwrite the previous image path, or would it append to it? Does it return the previous path?

I'm asking because I want to set each of my keywords to have it's own path for their images, but I don't want to type out each of their paths each time I pass one of the images. If it were to overwrite the path if I call it a second time and pass back the previous path, it would help me immensely.

Thanks for your response. </strike through>

_wait_process_started() raises exception sometimes in sikuli.py

Raises 'Start sikuli java process failed!' sometimes when starting sikuli java process in Windows Server 2008 R2 environment. Don't know the reason (maybe related to getting free tcp port?) but retrying _start_sikuli_java_process() in case of exception seems to help like in the code below:

def init(self, port=0, timeout=20.0, mode=''):
"""
@PORT: sikuli java process socket port
@timeout: Timeout of waiting java process started
@mode: if set as 'DOC', will stop java process automatically,
if set as 'PYTHON', means library is running in out of robot environment
"""
self.logger = self._init_logger()
self.timeout = float(timeout)
if int(port) == 0:
port = self._get_free_tcp_port()
self.port = port
start_retries = 0
started = False
while(start_retries < 5):
try:
self._start_sikuli_java_process()
except RuntimeError, err:
if(self.process):
self.process.terminate_process()
self.port = self._get_free_tcp_port()
start_retries += 1
continue
started = True
break
if not started:
raise RuntimeError('Start sikuli java process failed!')

    self.remote = self._connect_remote_library()
    if mode.upper().strip() == 'DOC':
        self._stop_thread(4)
    elif mode.upper().strip() == 'PYTHON':
        pass
    else:
        self._check_robot_running()

Create a keyword to start sikuli java process

In current implementation, java process will be started in "init". The reason is:

  1. RF will scan library and get keyword list(name, argument, doc) when initialize library.

The problems of current implementation are:

  1. When library works with RIDE, java process could not be stopped. This is handled by "check whether robot is running", but it is not good enough.
  2. When there are multi suites, as scope of library is GLOBAL, library will only be initialized once. If suite 1 "stop remote server", suite 2 will fail.

One proposal is:

  1. Add one keyword to start java process.
  2. Keep keywords information(name, arguments, doc) in one place(python file?), these information could be stored when library is packaged

Click In is Broken in certain cases. Request Click At Offset

For whatever reason, the "Click In" keyword seems to have this behavior:
First it finds image1 on the screen.
Then it finds image2 on the screen.
Then it clicks on the found image2.
Then it looks for image2 on the screen.

It works fine if nothing changes immediately after the click, but say you're clicking a radio button, or a + button that becomes a - once it expands a menu, or you are closing a window. In any of these situations the command does it's job and clicks where it needs to, and then reports failure, it could not find the image to click on.

The system I am running it on is Centos 6, and I cannot confirm if it works or does not work this way on other systems. I do not have them at my disposal.

This issue can be alleviated by creating a "Click At Offset" keyword that takes the image parameter, an X offset parameter, and a Y offset parameter that is number of pixels from the upper left hand corner of the image. This functionality already exists in Sikulix, and would simply be adding parameters to the filename for the image string that is given to Sikulix.

Bug in Right Click In

198 @RobotKeyword("Right click in. \nRight click target image in area image.")
199 @ArgumentNames({"areaImage", "targetImage"})
200 public void rightClickIn(String areaImage, String targetImage) throws Exception {
201 Match match = wait(areaImage, Double.toString(this.timeout));
202 System.out.println(areaImage + " is found!");
203 match.rightClick(targetImage);
204 capture(match.find(targetImage));
205 }

If there is a context menu opening then line 204 capture(match.find(targetImage)); might fail, because it might overlap with targetImage.

To fix this Line 204 should be before line 203:
204 capture(match.find(targetImage));
203 match.rightClick(targetImage);

Recognizing text in a linux GUI

Hi,

I have automated an Linux GUI based application using sikuli libray.

later because of an upgrade the fonts in the GUI has changed, for this scenario i cannot use image based automation tools, as color and font of text within the GUI changes frequently. it will be easy if i can search for an element using text instead of image.

Does SikuliLibrary support text search?

Regards,
Raghu

i think java process will never be terminated

i'm doing a lot of work with robot framework and sikuli.

everytime a step of a test fails, i run the test again.

after some time, Windows alerts me that ram is running low.

taking a look at the process manager, i think java process is never terminated as you can see.

image

there is also a lot of cmd.exe process opened, but in windows i use only ONE terminal window at time

image

maybe sikuli should check if there are any server avaiable before creating another one?

how i can try to debug this issue?

thanks.

Sikuli is unable to recognize image accurately

Hi,

i have an use case where i need to navigate through different pages in an application using left and right arrows. On the first page only right arrow will be enabled and it will be in "yellow" color, the left arrow will be disabled and will be in "grey" color. Problem is sikuli clicks on these arrows irrespective of its color i.e. even if i pass "yellow" colored image it clicks on grey colored image and my use case fails.

i have installed robot framework and sikuli in Ubuntu 14.04 server and accessing the application using VNC.
Could you please help us?

Regards,
Raghu

Drag and Drop in Sikuli; Can anybody help me for drag and drop by Offset using Sikuli.

Drag and Drop By Offset is available in Selenium2Library, but I need on SikuliLibrary as well,

  • I have to click on image and it needs to drag and drop to specific coordinate on an windows application. It is not possible using 'Drag and Drop' keywords as there is no specific target image. Like I want to draw a straight line on a graph.
    14by14 axes

Could you please help me, I am stack on here,
Thanks in Advance.

Mouse Down\Up Keywords

Hi,
According to documentation the Mouse Down & Mouse Up are getting mouseButtons argument, but in dead am getting that it's expecting 0 arguments!

In "robotframework-SikuliLibrary/src/java/com/github/rainmanwy/robotframework/sikulilib/keywords/ScreenKeywords.java" I can see that the implementation support the argument... but from robot its not.

I tried to uninstall it and reinstall with: python setup.py install but I got an error:

The directory '/Users/galil/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling robotframework-SikuliLibrary-0.1.5:
/Library/Python/2.7/site-packages/SikuliLibrary/init.py
/Library/Python/2.7/site-packages/SikuliLibrary/init.pyc
/Library/Python/2.7/site-packages/SikuliLibrary/lib/SikuliLibrary.jar
/Library/Python/2.7/site-packages/SikuliLibrary/sikuli.py
/Library/Python/2.7/site-packages/SikuliLibrary/sikuli.pyc
/Library/Python/2.7/site-packages/SikuliLibrary/version.py
/Library/Python/2.7/site-packages/SikuliLibrary/version.pyc
/Library/Python/2.7/site-packages/robotframework_SikuliLibrary-0.1.5-py2.7.egg-info
Proceed (y/n)? y
Successfully uninstalled robotframework-SikuliLibrary-0.1.5
The directory '/Users/galil/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
MacBook:LaunchDaemons galil$ cd ~
MacBook:~ galil$ cd git/robotframework-SikuliLibrary/
MacBook:robotframework-SikuliLibrary galil$ pip setup.py install
ERROR: unknown command "setup.py"
MacBook:robotframework-SikuliLibrary galil$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 10, in
with open(join(dirname(abspath(file)), 'target', 'src', 'SikuliLibrary', 'version.py')) as f:
IOError: [Errno 2] No such file or directory: '/Users/galil/git/robotframework-SikuliLibrary/target/src/SikuliLibrary/version.py'
MacBook:robotframework-SikuliLibrary galil$

B.R.

Documetation missing for how to activate OCR (tesseract)

I really want to try out OCR but every time I run a test using the Get Text keyword, I get the following error message:

[error] text: text recognition is currently switched off

I am stuck pointing robotframework-SikuliLibrary to sikuli with OCR enabled. I think it is because robotframework-SikuliLibrary does not use the Sikuli jar files I have installed on my system.

Any advice for how to enable text recognition?

So far I have

  • downloaded the latest version of robotframework-SikuliLibrary from github
  • mvn package
  • python setup.py install
  • Installed sikulix from http://sikulix.com/ and selected the Tesseract option
  • run SikuliIDE and enabled OCR in the options
  • confirmed that OCR works in SikuliIDE using a simple script containing just 'click ("sometext")'

SikulixLibrary for Robot Framework constantly throws the same exception

On Centos 6, the SikulixLibrary for Robot Framework keeps throwing the following exception:
11078 [qtp11556956098-27] ERROR org.apache.xmlrpc.server.XmlRpcErrorLogger - No such handler: get_keyword_tags

This seems to be thrown with every new test. A quick google of this error in apache tells me that either you aren't giving it the proper method name or not giving it a method at all. While it seems to run ok, it only does so for a while and then it's stability seems to start dropping after about 20-30 tests where it starts mismatching images (as if they're offset consistently) or not finding images it could find a minute ago.

Restarting the server corrects these issues, but it always throws this exception at least once for every test run.

Just a note, we are going to be using this for government testing, telling me to switch to Centos 7 won't help me as the government hasn't approved it as tested yet. That also goes for insisting that I install certain software that isn't tested for Centos 6. If you can find a way to help me get it running on Centos 6 without breaking any of the built in functionality it might be ok, but if it is going to break things like upgrading to Python 2.7 or installing glibc 2.14, It will break the OS without upgrading a significant portion to Centos 7, and that's out of the question. They are also insisting on using Centos over Windows. I'm just an intern, I don't make these decisions.

Run as Admin for Sikuli to Interact with Microsoft Management Console. Please add to Release Note/Readme.

I would like to add a note that through my recent testing, that Microsoft Management Console (MMC) will not let SikuliX perform any actions on it, unless SikuliX itself is started as an administrator. If you are using SikuliX only, it is easy, just start SikuliX IDE or run the SikuliX script in a console that was started as an administrator (ie: right click on cmd/console and select "run as administrator"). However, if you are using the SikuliLibrary and Robot framework, SikuliLibrary itself also needs to be started from the cmd window that was "run as administrator". Otherwise, you will get a lot of errors like:

[log] CLICK on L(1061,118)@S(0)[0,0 1920x1080]
[error] RobotDesktop: checkMousePosition: should be L(1061,118)@S(0)[0,0 1920x1080]
but after move is L(137,215)@S(0)[0,0 1920x1080]
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin.

Besides the above log error, the symptom is that the mouse itself does not move and will never interact with the MMC UI.

I have also set my UAC to the lowest level (not to notify the user). This does not mean that UAC is turned off, just that it does not have any unnecessary popup when your tests are being run (or you will have to take care of them in your test scripts).

It would help to add these observations to the readme/release notes, maybe under a Microsoft Windows section.

Importing Sikuli is causing a Jenkins Failure!

Hi,
A strange behavior that I'm facing when running my sikuli tests from jenkins...
The test cases themselves are passing, but at the end of the job jenkins is loosing the connection with the client:

Process leaked file descriptors. See (http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
for more information)
FATAL: Remote call on AU_9 failed
java.io.IOException: Remote call on AU_9 failed
at hudson.remoting.Channel.call(Channel.java:789)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:953)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:540)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

I followed the link in the error and there they are explaining about this problem and how it can be avoided (by starting jenkins with processTree disabled or by creating a deamon\service that is runing all the time and preventing from killing the child job).

However, my concern is why that is happening only when I do import for the sikuli in my test suite (even without running the TCs)?

Regards.

How to pass Ctrl+A, Shift+Down etc ?

Hi,

i have some scenarios where i need to use combination of two keys, like Ctrl+A, Shift+Down, Shift_Up.
however the keyword Press Special key accepts only one argument. I have to select all or few lines in a window using above key combinations, how can i achieve it?

Regards,
Raghu

"Some windows should contain"

Hi,

Screen Should Contain works only if the image sikuli is looking for is on foreground.

There is a way to make the same check in the application windows?

in my use case, the browser contains the image i'm looking for, but if browser is not in the foreground when sikuli runs, the test will fail.

thanks.

how to use this project with xvfb?

xvfb is a virtual display for linux operative system, and with this library https://github.com/drobota/robotframework-xvfb you can run robotframework in xvfb display,
so you can run test that needs a display (for example test with selenium2library) in a server environment.

i tried to make the same thing with sikuli,

but taking a look ad the failure screenshot in the sikuli_captured,

i understand that sikuli is not look at the virtual display, but it is using the normal display.

there is a way to say sikuli driver to use the virtual display environment?

thanks

Start sikuli java process failed!

Hi,
I got error in one of two machine as below (one is work fine) kindly to suggest.

[ ERROR ] Error in file 'D:\Teleconsultation_refactor\qa-automation-teleconsulltation\TestScenarios\MyProfile_MyMedicalInfo_MyMedicalCases_Page.robot': Initializing test library 'SikuliLibrary'
with no arguments failed: Start sikuli java process failed!

Traceback (most recent call last):
File "c:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 54, in init
self.start_sikuli_process(port)
File "c:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 92, in start_sikuli_process
raise RuntimeError('Start sikuli java process failed!')

Scroll new functionality (for iOS Device)

As known, in order to use Sikuli with iOS device there is a need for connecting to that device via VNC.
In order to enable scrolling functionality inside the VNC screen (cause the wheel method doesn't work in this case) I thought to use the VNCScreen class implemented in: https://github.com/RaiMan/SikuliX-2014

I generated the artifact of the SikuliX-2014 (with Maven install) and got the sikulixapi-1.1.1.jar
Will use it from SikuliLibrary and try to implement a scroll functionality...

VNCScreen vnc = VNCScreen.start("ip", port, 10, 10); //vnc.stop() ;

If you have any ideas\hints please share it.

Huge number of screeshots are collected

@rainmanwy

We run 200 test cases multiple time in a day. There are huge number of snapshots collected each day, their size is around 20GB. Is it possible to turn of capturing of snapshots? I just want to have a single snapshot before test case fails, rest should not be captured. Is it possible to implement this?

Regards,
Raghu

No keyword with name 'Set Ocr Text Read'

When trying to get text recognition I get the error:
20170301 11:54:49.772 : FAIL : No keyword with name 'Set Ocr Text Read' found.

I was trying the keyword Double Click and got the error:
[error] Image: Image not valid, but TextSearch is switched off!

Upgading to use sikulixapi 1.1.1 fails to build

I modified the pom.xml file to use sikulixapi version 1.1.1, but it failed to build as the dependency is missing. Sikuli version 1.1.1 has been officially released (https://launchpad.net/sikuli/sikulix/1.1.1). Is it possible to get the dependency on the sikulixapi JAR file fixed?

Can we get that api jar uploaded to maven central as soon as there is a new Sikuli X version available?

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building robotframework-SikuliLibrary 1.1.1
[INFO] ------------------------------------------------------------------------
Downloading: https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixapi/1.1.1/sikulixapi-1.1.1.pom
Downloading: https://labs.consol.de/maven/repository/com/sikulix/sikulixapi/1.1.1/sikulixapi-1.1.1.pom
[WARNING] The POM for com.sikulix:sikulixapi:jar:1.1.1 is missing, no dependency information available
Downloading: https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixapi/1.1.1/sikulixapi-1.1.1.jar
Downloading: https://labs.consol.de/maven/repository/com/sikulix/sikulixapi/1.1.1/sikulixapi-1.1.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.498 s
[INFO] Finished at: 2017-07-18T16:44:10-04:00
[INFO] Final Memory: 6M/17M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project robotframework-SikuliLibrary: Could not resolve dependencies for project com.github.rainmanwy.robotframework:robotframework-SikuliLibrary:jar:1.1.1: Could not find artifact com.sikulix:sikulixapi:jar:1.1.1 in com.sikulix (https://oss.sonatype.org/content/groups/public) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1

[brainstorming] - how to detect WHY Screen recognition fails?

This is my use case

with seleniumlibrary, i take screenshot of the web browser.

engineering team release a new version

with sikuli i run test in order to undertand if something is different.

some area should to be different and this is ok,

some other area doesn't have to change, so if there are some change there are some regression.

good.

some time i'm in difficult to understand WHY a test fail versus image recognition.

if the image comparison was against the same screen area and same resolution , i can use pillow to make a image diff, but with sikuli, that search for an image everywhere in the screen, how i can obtain this result? any suggestion?

version.py path constructor error

When trying to install your library by:
pip3.5 install git+https://github.com/rainmanwy/robotframework-SikuliLibrary.git

i got the following output:

> 
Collecting git+https://github.com/rainmanwy/robotframework-SikuliLibrary.git
  Cloning https://github.com/rainmanwy/robotframework-SikuliLibrary.git to c:\users\fabior~1\appdata\local\temp\pip-_isf3xho-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\FABIOR~1\AppData\Local\Temp\pip-_isf3xho-build\setup.py", line 10, in <module>
        with open(join(dirname(abspath(__file__)), 'target', 'src', 'SikuliLibrary', 'version.py')) as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\FABIOR~1\\AppData\\Local\\Temp\\pip-_isf3xho-build\\target\\src\\SikuliLibrary\\version.py'

using windows 10, Python 3.5 freshly download from python.org
I used the git version, because normal pip install has the execfile syntax from 2.x python, and i'm using 3.x

Multiple image search

Would be nice to have keyword that would search for multiple images from screen. For example functionality of 'Wait Until Screen Contain' and 'Wait Until Screen Not Contain' in single keyword. Sometimes you need wait for 'success' image and 'failure' image on screen at the same time. If the 'failure' image could be detected in addition to 'success' image then you shouldn't have to wait for timeout in case of just being able to use 'Wait Until Screen Contain success.png'.

Keyword could be something like 'Wait For Images wantedImageToWait notWantedImage
ToWait'

Maybe could use this http://doc.sikuli.org/region.html#Region.observe

Unable to build with Maven

C:\src\robotframework-SikuliLibrary>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building robotframework-SikuliLibrary 1.0
[INFO] ------------------------------------------------------------------------
Downloading: http://pz-ci:8081/artifactory/remote-repos/jxgrabkey/jxgrabkey/1.0/jxgrabkey-1.0.pom
[WARNING] The POM for jxgrabkey:jxgrabkey:jar:1.0 is missing, no dependency information available
Downloading: http://pz-ci:8081/artifactory/remote-repos/jxgrabkey/jxgrabkey/1.0/jxgrabkey-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.955 s
[INFO] Finished at: 2017-09-26T16:38:43+02:00
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project robotframework-SikuliLibrary: Could not resolve dependencies for project com.github.rainmanwy.robotframework:robotframework-SikuliLibrary:jar:1.0: Could not find artifact jxgrabkey:jxgrabkey:jar:1.0 in remote-repos (http://pz-ci:8081/artifactory/remote-repos) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

C:\src\robotframework-SikuliLibrary>

java process in not closing after script execution.

Hi,

I'm using robotframework 3.0. installed Sikuli library from source using maven. When i run a script SikuliLibrary.jar is started, even after script execution is completed the java process is still running. next time when i run the script again a new process is created. i'm facing this issue in both Linux(RHEL) and Windows.

i will be running multiple scripts repeatedly and because of this issue RAM is getting filled with java process.
here is the java process from linux server

root 21509 1 0 08:59 pts/26 00:00:16 java -jar /usr/jython/Lib/site-packages/SikuliLibrary/lib/SikuliLibrary.jar 55994 /tmp/xtttrrr
root 21769 1 0 11:27 pts/32 00:00:17 java -jar /usr/jython/Lib/site-packages/SikuliLibrary/lib/SikuliLibrary.jar 59637 /tmp/xtttrrr

Regards,
Raghu

Paste text keyword issue with updated SikuliLibrary

Hi,

Paste text keyword doesn't seem to work properly with new updated SikuliLibrary (version 1.0.1 version.py).

On older versions calling keyword from robot Paste Text \ cmd worked, now same results with error:
pastetextfails

I'm running SikuliLibrary server applet on a remote device running Windows 10 and have configured sikuli.py to use Python mode. EDIT: This is exactly same setup which were used with older SikuliLibrary

Input text seems to work fine with same parameters as above.

if image is not found, match score is 0, but keyword should say that image is not found

due i'm moving from window to linux the same tests , i make a mistake with the use of the \ or // so, in windows, this path works

${IMAGE_DIR} ${CURDIR}\img

but in linux, it should to be

${IMAGE_DIR} ${CURDIR}//img

so, when i try

Screen Should Contain image.png

the keyword fails, but the reason is that image.png is not found in ${CURDIR}\img path , and no that screen doesn't contains image.png

i think the keyword should return a special message if the image is not found.

tips :
to make the path operative system indipendent, we can use /

@rainmanwy what do you think? i'm your worst nightmare? :)

Improve linux installation documentation (someone can help me to install?)

Hi,

i'm installing robotframework-sikulilibrary on linux mint.

i'm a newbie of manual maven/python installation and i have some problems.

Here

https://github.com/rainmanwy/robotframework-SikuliLibrary#pip-installation

i read to download the linux version from https://pypi.python.org/pypi/robotframework-SikuliLibrary , but there i read that the jar is not provided so i need to build it with maven, then i understand to return back to

https://github.com/rainmanwy/robotframework-SikuliLibrary#build-with-maven

and build manually with maven.

Question number one : one the previous step send me to pypi if pypi send me to manual installation by maven? maybe documentation should avoid to send me to pypi?

then, i proceed following "build with maven" step.

  1. cloning
  2. build with maven

mvn package

due mvn package fails , i install the java jdk with apt-get install default-jdk

now maven build the package.

following the instructions,

  • One zip file will be created in "target" folder, could unzip this file and add to PYTHONPATH
  • If want to installed to python, please execute

should i do both operation, or the second will automatically move the file to the PYTHONPATH?

i think the manual move is not necessary because

/usr/local/lib/python2.7/dist-packages/SikuliLibrary/lib/SikuliLibrary.jar

now exists.

so, when i run a simple test that on Windows works,

i obtain that the server is not running on a ... random port.

i can run the server on a port as described in the documentation, for example in port 10000 , but when i run robot again, no server is listening on ... another port.

[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:40500/ failed: [Errno 111] Connection refuse

java -jar /usr/local/lib/python2.7/dist-packages/SuliLibrary/lib/SikuliLibrary.jar 40500 .
0 [main] INFO org.robotframework.remoteserver.RemoteServer  - Mapped path / to library com.github.rainmanwy.robotframework.sikulilib.SikuliLibrary.
1 [main] INFO org.robotframework.remoteserver.RemoteServer  - Robot Framework remote server starting
1 [main] INFO org.eclipse.jetty.server.Server  - jetty-7.x.y-SNAPSHOT
37 [main] INFO org.eclipse.jetty.server.handler.ContextHandler  - started o.e.j.s.ServletContextHandler{/,null}
120 [main] INFO org.eclipse.jetty.server.AbstractConnector  - Started [email protected]:40500
121 [main] INFO org.robotframework.remoteserver.RemoteServer  - Robot Framework remote server started on port 40500.
robot visual.robot 
[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:52939/ failed: [Errno 111] Connection refused

should i manually set a port during import phase as described here http://rainmanwy.github.io/robotframework-SikuliLibrary/doc/SikuliLibrary.html ?

why in Windows this is not necessary?

thanks for your help,

then, when i understand a bit more, i will propose a documentation commit.

Does it support the Chinese input?

I want to type Chinese characters, but it seems doesn't support. I saw paste(u"δΈ­ζ–‡") can be ok in sikuliapi. Then how to input Chinese characters?

how to handle png with transparent background?

i need to check that a downloaded png with transparent background still has the transparent background on the browser after the png conversion.

how to handle images with trasparent background?

if you open this image with windows, you see there is no background, but chrome "render" this background image with a lot of "squares".

how to handle this use case?

thanks
trasparente

image

These two images are more similar than 0.99?

in my test case this comparison return TRUE (Screen Should Contain) with min similarity 0.99
20-contents-read write share-folder-read write share_content_preview_bk
20-contents-read write share-folder-read write share_content_preview

and this are the difference

image

calculated with Online Image Diff.

so the "red area" (the different) are less than 1% of the image?

thanks.

SikuliLibrary vs SikuliX IDE

Hi,
I'm trying to run sikuli on iOS device (connecting to it via VNC) but am facing issues with the image recognition!

If I try to click on Safari.png for example am getting match score = 0.88(Get Match Score Keyword)
But when I tried for other apps (Chrome, Netflix, ...) am getting the score as ZERO!!!

If I use SikuliX IDE to click on the same images it works fine.

I have most updated version:MacBook:~
$ pip install robotframework-sikulilibrary
Requirement already satisfied (use --upgrade to upgrade): robotframework-sikulilibrary in /Library/Python/2.7/site-packages

The Keyword "Click" does not work well at Offset

I have some difficults to use the keyword "Click".First,I get the xOffset and yOffset of one image though Sikulix IDE,xOffset=-58,yOffset=-22.Then,the parameters passed to the keyword Click,including image,xOffset,yOffset,so as to delete the image. Run this script,it clicks outside of the image, I do not know why.

how to debug sikuli failure (maybe taking a full page screenshot on failure?)

this is not an issue, is much more a help request.

i have a test that use sikuli.

my test open a browser with selenium2library and use sikuli in order to find and click some elements.

by jenkins, i schedule the execution of the same test every 10 minutes.

the test runs in a stand alone laptop that any one use with only robot framework, jenkins and the test.

the test normally works, but sometime it fails

image

i would be able to see what there is on the screen when the test fail, but in the log i have nothing useful.

as you can see, the image path is not found

image

the image path is http://localhost:8080/job/cloudconvert/102/robot/report/sikuli_captured/sikuliximage-1494400773412.png

but there is any captured image here

image

This is the configuration

image

Normally there are image in the previous folder,

but in order to create this ticket i delete all because i'm never be able to find the image related with the log.

i know that should be a jenkins question and not a sikuli related one, but should i setup a webserver ?

there is also a way to set a "capture full page screenshot" on failure?

thanks for those advices,

i would to create a wiki page for sharing suggestion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.