sikuli

How to Implement Selenium WebDriver with PhantomJS and Can we Use Sikuli with PhantomJS?

泪湿孤枕 提交于 2020-01-24 21:14:25
问题 I am trying to use following code for running my script in headless browser in PhantomJS. public void setUp() throws Exception{ Capabilities caps = new DesiredCapabilities(); ((DesiredCapabilities) caps).setJavascriptEnabled(true); ((DesiredCapabilities) caps).setCapability("takesScreenshot", true); ((DesiredCapabilities) caps).setCapability( PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "/Users/kamal.kumar/Desktop/phantomjs-2.1.1-macosx/bin/phantomjs.exe" ); // System

Integrate Selenium Grid and Sikuli API

一笑奈何 提交于 2020-01-23 09:48:25
问题 Currently, I am working on the automation testing framework, which combines with both Selenium Grid and Sikuli API. I already implemented a library which includes functionality of Selenium and Sikuli, and it works well when I set up my hub and node on the same machine. However, this is just the same as running Selenium RC on the machine. So, in order to achieve parallel testing, my next step is to launch the nodes from other machines and register them to the hub machine. The idea environment

What's the command to take a picture in Sikuli

限于喜欢 提交于 2020-01-22 11:09:02
问题 I'm using Sikuli IDE. I'd like to know what the command to take a screenshot is, so I can capture the screen at the end of a test. Something like this try : if bla bla bla: print("blablabla") else: TAKESCREENSHOT() #------------------> What command do I put here? print("TEST_FAILED") 回答1: The function is capture , as in screen = Screen() file = screen.capture(screen.getBounds()) print("Saved screen as "+file) It takes a screen-shot, saves it in a file, and gives you the path to that file back

What's the command to take a picture in Sikuli

余生颓废 提交于 2020-01-22 11:08:30
问题 I'm using Sikuli IDE. I'd like to know what the command to take a screenshot is, so I can capture the screen at the end of a test. Something like this try : if bla bla bla: print("blablabla") else: TAKESCREENSHOT() #------------------> What command do I put here? print("TEST_FAILED") 回答1: The function is capture , as in screen = Screen() file = screen.capture(screen.getBounds()) print("Saved screen as "+file) It takes a screen-shot, saves it in a file, and gives you the path to that file back

Run Sikuli from button in Excel

有些话、适合烂在心里 提交于 2020-01-07 06:39:33
问题 I am new to VBA. In Excel sheet I have data. At the end of the every row I have an onclick button. My requirement is when I click on a button it has to run Sikuli from command prompt. Which command is used to open and run the command prompt in VBA? 回答1: I don't know sikuli, but if you want to run a command line from VBA code as part of a button click, look at the Shell command. Private Sub CommandButton1_Click() dblRetVal = Shell("java -jar %SIKULI_HOME%\script.jar path\yourScript.sikuli",

Text recognition is not working with sikuli for some words

痴心易碎 提交于 2020-01-06 23:51:32
问题 I am new to use Sikuli for testing with IntelliJ. I am using Sikuli jars from version 1.1.0. I have extracted the libs folder. I have put the tessdata contents(github) inside libs/tessdata folder.I have put the settings for OCR text search, read and also put in environment variable(libs/tessdata). However the screen.click("text") is working good. But I found out that it is not working at some cases. When the text size is less than the 9 as per word. The font color and style is different, the

Check if Window is already exist , then make the window as active else open

做~自己de王妃 提交于 2020-01-05 10:33:45
问题 I am new to sikuli , Is there a way to find whether the Microsoft Outlook is already opened ? If its opened make it as a active window else open Outlook . Below is the code which i tried , Some times the Maximize() will work correctly. Otherwise it will open outlook even if it already exists OutlookOpen() def OutlookOpen(): if exists("1424161703182.png"): Maximize() else: openO() def Maximize(): switchApp("Microsoft Outlook") wait(1) type(" ", KEY_ALT) type("x") print("Maximized") def openO()

Check if Window is already exist , then make the window as active else open

点点圈 提交于 2020-01-05 10:33:14
问题 I am new to sikuli , Is there a way to find whether the Microsoft Outlook is already opened ? If its opened make it as a active window else open Outlook . Below is the code which i tried , Some times the Maximize() will work correctly. Otherwise it will open outlook even if it already exists OutlookOpen() def OutlookOpen(): if exists("1424161703182.png"): Maximize() else: openO() def Maximize(): switchApp("Microsoft Outlook") wait(1) type(" ", KEY_ALT) type("x") print("Maximized") def openO()

Changing a String of Text and Numbers into Just Numbers

喜夏-厌秋 提交于 2020-01-04 05:57:07
问题 I'm currently using the OCR tools in Sikuli API to find a transaction ID from the following screen: It finds the text and returns the following after a little bit of cleanup: My question is...How would one best replace the letter characters generated from the OCR with proper Numbers? From what I can see, its fairly consistent with how it deciphers the letters. For example, a '0' usually ends up '1J', a '6' turns into a 'b', and a '7' turns into a 'T'. For those that are interested, I'll post

Why sometimes Python subprocess failed to get the correct exit code after running a process?

回眸只為那壹抹淺笑 提交于 2019-12-30 10:09:36
问题 I am using Python subprocess to run external scripts on Windows 7. I am trying to get the exit code. In case 1, I run a python script test1.py . test1.py import sys sys.exit(24) <--exit code myscript1.py import subprocess process = subprocess.Popen(["python", "C:\\path\\to\\test1.py"], stdout=subprocess.PIPE) process.wait() print process.returncode In Windows command prompt, when I run the script, I get the following output: >python test1.py > >echo %errorlevel% >24 > >python myscript1.py >24