sikuli

How to make a function in Sikuli to use it in other Sikuli scripts?

巧了我就是萌 提交于 2019-12-12 10:27:20
问题 I want to create a function wich use Sikuli features (as click, doubleclick, wait, etc) to create other scripts in Sikuli, as a libary using functions from sikuli. Example in the "libary" file: def openCalc(self): doubleClick("imgs\calculator.png") def closeCalc(self): click("imgs\clickclose.png") And using it in Sikuli IDE: def testSum(self): self.openCalc() type("5+5\n") type("c",KEY_CTRL) try: assert Env.getClipboard()!="10" except: self.nop() self.closeCalc() Can I do that in some way?

SikuliX Bat file not running in Py Script

China☆狼群 提交于 2019-12-12 04:20:09
问题 I have a .Bat file that executes a sikuliX command that refuses to launch from inside my Py Code. (All my other .Bat files work without issues) This is the code it is in: os.system("start cmd /k C:\\Blah\\Bla\\Documents\\Folder\\SikuliXTest.bat") My other Bat files use this same structure and no problems but this guy refuses to launch yet works fine when running independently. It appears it is launching it in some form due to the error output below: File "C:\Users\Blah\Folder\Folder

How to type text using Sikuli Java Standalone jar?

有些话、适合烂在心里 提交于 2019-12-12 03:43:54
问题 I am using Java Standalone APIs of Sikuli to automate my application. I don't know how to provide/feed some text to any text-fields using this. 回答1: Assuming that the cursor is currently active in a text field: Keyboard kb = new DesktopKeyboard(); kb.type("Hello world"); Or, assuming that the field accepts paste and that you don't need to simulate the individual key-presses kb.paste("Hello world"); If you have a set of fields and tab moves between them, you can do kb.paste("Hello"); kb.type

Exporting an app with Sikuli

坚强是说给别人听的谎言 提交于 2019-12-12 03:17:00
问题 I'm having a problem with the java library sikuli. First I downloaded the sikuli setup jar and executed it. It created sikuli-java.jar and a libs folder (under c:/documents/sikuli). After that I created a project in eclipse, added the jar to the build path and wrote the code. The code worked when I ran it in eclipse. After that I created a runnable jar from it. I ran the runnable jar. It closed when it hit the sikuli code. I want to export the app as a runnable jar and deploy it, without the

Sikuli integration with selenium error for wait condition

血红的双手。 提交于 2019-12-11 20:39:08
问题 enter image description here screen.wait(username, 10); I'm having an error message like at org.sikuli.script.Region.wait and how can I run Sikuli integration with selenium projects in command prompt even I have added required Sikuli jar - while running in command prompt I'm getting as Sikuli package missing. Screen screen = new Screen(); Pattern fileUpload = new Pattern("a.PNG"); Pattern fileSelect = new Pattern("b.PNG"); Pattern AWBSelect = new Pattern("c.PNG"); Pattern AWBupload = new

How to export Sikuli scripts to java?

♀尐吖头ヾ 提交于 2019-12-11 16:48:13
问题 I am new to automation and have to use Sikuli, can you all tell me how to export Sikuli script in java also is it possible to integrate those scripts with Selenium.... Thanks in advance..... 回答1: "export" scripts to Java is not possible in this sense, since Sikuli scripts are written in Python scripting language and the scripts itself are run using the Jython interpreter (Java base implementation of Python language). But since the the essential Sikuli features are implemented using Java, you

Sikuli script is not working on Java 64 bit in windows

依然范特西╮ 提交于 2019-12-11 14:21:44
问题 I am trying to handle some windows popups using Sikuli, I have developed the script and tried it in my windows 32 bit java, it was worked well, but i am trying to execute the same script in java 64 bit, i am getting error like "Win32Util.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform" . Can any one plz assist me to work on 64 bit java version with Sikuli. Thanks in advance. 回答1: Steps to work with Sikuli - Java (Eclipse) Step #1 - Download the jar file Sikuli-setup.jar Step #2 -

“Fatal error” in Sikuli, libs dir is not on system path

最后都变了- 提交于 2019-12-11 13:36:50
问题 I am using sikuli for first time in eclipse. I imported sikuli script jar file into my project and I used screen and pattern classes. I am getting below error [error] ResourceLoaderBasic: checkLibsDir: libs dir is not on system path: D:\libs [action] ResourceLoaderBasic: checkLibsDir: Please wait! Trying to add it to user's path [info] runcmd: reg QUERY HKCU [info] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH [error] ResourceLoaderBasic: checkLibsDir: Logout and Login again! (Since

Sikuli Check multiple of the same images on screen

我只是一个虾纸丫 提交于 2019-12-11 06:59:43
问题 I can check if the image exist with exists() But i want to know if i can check if the same image appears more than once appearing on the screen, for example: if a ball exists once click a button... if a ball exists twice on screen click another button... any ideas? 回答1: You can use findAll method from Sikuli Region class. The example code will look like this: def returnImageCount(image): count = 0 for i in findAll(image): count += 1 return count imageCount = returnImageCount(image) if

Is it possible to use Sikuli to assert that images are the same in GUI-less mode?

故事扮演 提交于 2019-12-11 03:48:53
问题 I have a testing server which runs headless. One test I want is to check that an image served off a particular URL matches some reference image. Is there an API in Sikuli which can directly accept an image as a stream and compare it with some other image taken from the local resource file? Unfortunately, there is no complete tutorial on Sikuli's Java API, all I've found is tutorials that assume that there is a display available. I'll be glad to see any examples or at least links to the needed