Re: [Sikuli-driver] [Question #621227]: Sikuli not mathing images taken with native MAC OSX Screen Snipping Tool
Question #621227 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/621227 Chris Rhoads posted a new comment: Will verify and update. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #621227]: Sikuli not mathing images taken with native MAC OSX Screen Snipping Tool
New question #621227 on Sikuli: https://answers.launchpad.net/sikuli/+question/621227 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.Assert; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.sikuli.basics.Debug; import org.sikuli.script.*; import javax.swing.*; import java.awt.event.KeyEvent; import static org.sikuli.script.Commands.click; /** * 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(Main.class.getResource("LogMeInDownloadBarIcon.png")).similar((float) 0.75); private static final Pattern lmiDownloadZip = new Pattern(Main.class.getResource("LogMeInZip.png")).similar((float) 0.75); private static final Pattern lmiClientLaunch = new Pattern(Main.class.getResource("LMIClientIcon.png")).similar((float) 0.75); private static final Pattern osxOpenConfirmation = new Pattern(Main.class.getResource("osxOpenConfirmation.png")).similar((float) 0.75); //End of Client download images //Start of Remote RIB Exit Objects private static final Pattern ribSignOut = new Pattern(Main.class.getResource("RIB_Client_SignOutBtn.png")); //shows up after hitting Ctrl+Alt+Delete with active sign in to VM private static final Pattern clientXit = new Pattern(Main.class.getResource("RIB_Client_Window_Exit.png")); //private static final Pattern clientXitConfirm = new Pattern(Main.class.getResource("RIB_Client_Window_Exit_Confirm")); //End of Remote RIB Exit Objects private static final Pattern sideBarAd = new Pattern(Main.class.getResource("sideBarAd.png")); public static void main(String[] args) throws FindFailed, InterruptedException { Screen s = new Screen(); Debug.on(3); WebDriver driver = new ChromeDriver(); driver.navigate().to("https://www.logmein.com;); driver.manage().window().maximize(); WebDriverWait wait = new WebDriverWait(driver, 10); driver.findElement(By.linkText("Log In")).click(); //Thread.sleep(3000); System.out.println("Login Button #1 was just clicked."); wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#email"))); WebElement email = driver.findElement(By.cssSelector("#email")); WebElement password = driver.findElement(By.cssSelector("#password")); WebElement logInBtn = driver.findElement(By.cssSelector("#btnSubmit")); //login creds are not legit for sake of public posting email.click(); email.clear(); email.sendKeys("chris.rho...@testemail.com"); password.click(); password.clear(); password.sendKeys("password"); logInBtn.click(); try { //wsLogInBtn1 = new Pattern(); s.wait(wsRibId,30); s.click(wsRibId); System.out.println("First Attempt To Find Image."); } catch(FindFailed f) { System.out.println("Exception In First Attempt: " +f.getMessage()); Assert.fail("Image wasn't found. Please use correct image."); } Thread.sleep(1000); System.out.println("Finding Remote RIB."); //In case image/object wasn't clicked in first attempt and cursor stays in the same screen, then do second attempt. if(s.exists(wsRibId) != null) { try { s.getLastMatch().doubleClick(wsRibId); System.out.println("Second Attempt To Find Image."); //System.out.println("Object: " +imageLocation + " is clicked successfully."); } catch(FindFailed f) { System.out.println("Exception In Second Attempt: " +f.getMessage()); //System.out.println("FindFailed
Re: [Sikuli-driver] [Question #621227]: Sikuli not mathing images taken with native MAC OSX Screen Snipping Tool
Question #621227 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/621227 Status: Open => Solved Chris Rhoads confirmed that the question is solved: After much experimentation I discovered the issue is with the images themselves. The native mac OS snipping tool does not take the image at the proper resolution, it seems retina resolution is too high. I used Apowersoft Mac Screenshot. In order for it to work you must set its resolution to 'Standard' and not retina. The screenshots I took with this resolution setting began working immediately. I hope this helps anyone else struggling with this! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #621227]: Sikuli not mathing images taken with native MAC OSX Screen Snipping Tool
Question #621227 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/621227 Status: Answered => Open Chris Rhoads is still having a problem: Verified and Reinstalled sikulixapi.jar v1.1.1 into my java project. Image matching issue still existing. *CONSOLE OUTPUT* Starting ChromeDriver 2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f) on port 35216 Only local connections are allowed. Apr 17, 2017 12:04:42 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS Login Button #1 was just clicked. Login Button #2 was just clicked. RIB list should now be visible. Sleep ended, waiting for visibility of central_profile_menu' Visibility of central_profile_menu CONFIRMED [debug] Region: wait: waiting 30.0 secs for /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png to appear in S(0)[0,0 1680x1050] [debug] Region: wait: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png appeared (M[317,747 86x14]@S(S(0)[0,0 1680x1050]) S:0.98 C:360,754 [1085 msec]) [debug] Region: wait: waiting 3.0 secs for /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png to appear in S(0)[0,0 1680x1050] [debug] Region: checkLastSeen: still there [debug] Region: wait: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png appeared (M[317,747 86x14]@S(S(0)[0,0 1680x1050]) S:0.98 C:360,754 [131 msec]) [debug] Region: init: (0, 0, 5, 5) [debug] CLICK on L(360,754)@S(0)[0,0 1680x1050] (767 msec) First Attempt To Find Image. Finding Remote RIB. [debug] Region: exists: waiting 3.0 secs for /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png to appear in S(0)[0,0 1680x1050] [debug] Region: checkLastSeen: still there [debug] Region: exists: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png has appeared (M[317,747 86x14]@S(S(0)[0,0 1680x1050]) S:0.98 C:360,754 [130 msec]) [debug] Region: wait: waiting 3.0 secs for /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png to appear in M[317,747 86x14]@S(0) [debug] Region: checkLastSeen: still there [debug] Region: wait: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeIn_Computers_RibIdNum.png appeared (M[317,747 86x14]@S(S(0)[0,0 1680x1050]) S:0.98 C:360,754 [4 msec]) [debug] DOUBLE CLICK on L(360,754)@S(0)[0,0 1680x1050] (694 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/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeInDownloadBarIcon.png to appear in S(0)[0,0 1680x1050] [debug] Region: handleFindFailed: P(/Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeInDownloadBarIcon.png) S: 0.5 Exception in thread "main" junit.framework.AssertionFailedError: Image wasn't found. Please use correct image. [debug] Region: wait: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeInDownloadBarIcon.png did not appear [30074 msec] at junit.framework.Assert.fail(Assert.java:47) Exception In First Attempt: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/target/classes/LogMeInDownloadBarIcon.png: (272x48) in S(0)[0,0 1680x1050] E:Y, T:3.0 at Main.main(Main.java:228) [debug] RunTimeAPI: final cleanup [debug] FileManager: deleteFileOrFolder: /var/folders/17/wvgjzfkd06z_qp2gmzfwfvghgn/T/Sikulix_488896334 Process finished with exit code 1 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #644415]: Unable to find Pattern within a pre set region on the screen.
New question #644415 on Sikuli: https://answers.launchpad.net/sikuli/+question/644415 Attempting to set a region for each Pattern I need to find in order to improve consistency of where the mouse is clicking. So Im setting the region (x,y,w,h) and I set the screen as Im using two monitors (I'm basing which screen off the other patterns that are already locating without a defined region) I'm obviously setting something up incorrectly and not understanding how to do it properly. Using Java on a MacBook Pro running Sierra 10.12.5 >CODE HERE<< public void click9() throws FindFailed, InterruptedException { Region reg = new Region(1310,654,73,68); Screen scr1 = new Screen(0); try { scr1.setROI(reg); System.out.println("setROI(reg) completed."); scr1.click(POSItemQty9); System.out.println("Found 9 inside specified posItem9reg."); //reg.click(POSItemQty9); THIS DOESNT WORK!!! System.out.println("First Attempt To Find POSItemQty9 ."); } catch (FindFailed f) { System.out.println("Exception In First Attempt: " + f.getMessage()); Assert.fail("Image wasn't found. Please use correct image."); } } >> First Attempt To Find Image. [log] DOUBLE CLICK on L(1240,199)@S(0)[0,0 1680x1050] (681 msec) Second Attempt To Find Image. Waiting on EatInTotal button to appear. EatInTotal button has appeared. User has now accessed the POS system. posOrderGeneration() has just entered logInCashier and userCreatedSales objects have just been created userLogged has been detected, now entering 'userCreatesSales.generate200InSales();' generate200InSales method has just entered... setROI(reg) completed. Exception In First Attempt: /Users/chrisrhoads/IdeaProjects/SikuliScript_POS/src/test/java/resources/RIB_POS/POSItemQty9.png: (35x44) in S(0)[0,0 1680x1050] E:Y, T:3.0 junit.framework.AssertionFailedError: Image wasn't found. Please use correct image. at junit.framework.Assert.fail(Assert.java:47) at com.qsrsoft.PageObjects.Utilities.userCreatesSales.click9(userCreatesSales.java:173) at com.qsrsoft.PageObjects.Utilities.userCreatesSales.buy9BigMac(userCreatesSales.java:381) at com.qsrsoft.PageObjects.Utilities.userCreatesSales.generate200InSales(userCreatesSales.java:72) at com.qsrsoft.PageObjects.RIB_POS_MainPage.posOrderGeneration(RIB_POS_MainPage.java:63) at pos_tests.userPlacesEatInOrder.posOrder(userPlacesEatInOrder.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:661) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301) at org.testng.TestNG.runSuitesLocally(TestNG.java:1226) at org.testng.TestNG.runSuites(TestNG.java:1144) at org.testng.TestNG.run(TestNG.java:1115) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127) Any and all help/guidance is much appreciated! Crhoads1024 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp