Sikuli not mathing images taken with native MAC OSX Screen Snipping Tool
I'm having issues with sikuli matching images.
I'm writing a selenium script in Java with sikuli-api 1.2.0 that logs into a remote pc program, finds a terminal by image of its terminal ID, clicks it and then downloads a client zip file.
It mostly works except sikuli is only able to recognize and act on 1 image and Ive got about 30 I need to use.
The one image that it recognizes was taken with Nimbus screenshot tool, the rest were taken with the native Mac OSX screen shot tool.
wsRibId gets recognized - taken with Nimbus
lmiDownloadBarIcon - not recognized taken with native MAC tool
Both are in the same folder within the project.
Ive tried with and without similarity with their pattern objects....
Any help is greatly appreciated!
Code is below.
import junit.framework
import org.openqa.
import org.openqa.
import org.openqa.
import org.openqa.
import org.openqa.
import org.openqa.
import org.openqa.
import org.sikuli.
import org.sikuli.
import javax.swing.*;
import java.awt.
import static org.sikuli.
/**
* Created by chrisrhoads on 4/11/17.
*
* Point Of Sale Terminal (POS) Remote Rib Visual Testing
* Powered By Sikuli API -- www.sikuli.org
*
*/
public class Main {
//Start of Client download images
private static final Pattern lmiDownloadBarIcon = new Pattern(
private static final Pattern lmiDownloadZip = new Pattern(
private static final Pattern lmiClientLaunch = new Pattern(
private static final Pattern osxOpenConfirmation = new Pattern(
//End of Client download images
//Start of Remote RIB Exit Objects
private static final Pattern ribSignOut = new Pattern(
private static final Pattern clientXit = new Pattern(
// private static final Pattern clientXitConfirm = new Pattern(
//End of Remote RIB Exit Objects
private static final Pattern sideBarAd = new Pattern(
public static void main(String[] args) throws FindFailed, InterruptedExce
Screen s = new Screen();
WebDriver driver = new ChromeDriver();
WebElement email = driver.
WebElement password = driver.
WebElement logInBtn = driver.
//login creds are not legit for sake of public posting
try
{
}
{
}
//In case image/object wasn't clicked in first attempt and cursor stays in the same screen, then do second attempt.
{
try
{
}
{
}
}
//*****
At this point the zip file will be visible in the lower dock of the Chrome Window, which is where the script fails.
Ive tried with several other images as well, using keyEvents to tab to the downloads folder and then look for the
FileName.zip and click or double click on it, I cant get anything to locate.
I had to switch to the mac screenshot tool in orfer to capture outside a web page but many tutorials I have seen
using snippet and navigated Windows file structure based purely on images and it works for them.
//*****
try
{
}
{
}
{
try
{
}
{
}
}
//*****
[debug] Region: wait: waiting 30.0 secs for /Users/
[debug] Region: wait: /Users/
[debug] Region: wait: waiting 3.0 secs for /Users/
[debug] Region: checkLastSeen: still there
[debug] Region: wait: /Users/
[debug] Region: init: (0, 0, 5, 5)
[debug] CLICK on L(360,754)@S(0)[0,0 1680x1050] (805 msec)
First Attempt To Find Image.
Finding Remote RIB.
[debug] Region: exists: waiting 3.0 secs for /Users/
[debug] Region: checkLastSeen: still there
[debug] Region: exists: /Users/
[debug] Region: wait: waiting 3.0 secs for /Users/
[debug] Region: checkLastSeen: still there
[debug] Region: wait: /Users/
[debug] DOUBLE CLICK on L(360,754)@S(0)[0,0 1680x1050] (695 msec)
Second Attempt To Find Image.
Logging in to remote RIB Console
Remote Client Software Download started.
Sending Keystrokes to try to access the downloads folder
[debug] Region: wait: waiting 30.0 secs for /Users/
[debug] Region: handleFindFailed: P(/Users/
[debug] Region: wait: /Users/
Exception In First Attempt: /Users/
Exception in thread "main" junit.framework
at junit.framework
at Main.main(
[debug] RunTimeAPI: final cleanup
[debug] FileManager: deleteFileOrFolder:
/var/folders/
Process finished with exit code 1
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Chris Rhoads
- Solved:
- Last query:
- Last reply: