← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #274766]: SikuliX v1.1.0 Java API supported OS's

 

Question #274766 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/274766

kschmidt gave more information on the question:
Here is the code stripped of logging and proprietary data. The
getImage() call simple gets a new Image object from the project
resources.

     // The browsers is already running at this point, but I want to make sure it is at the top of the z-order/foreground
    App app = new App("Google Chrome");
    app.focus();

     // I have multiple displays so I need to check them all to find the desired image
    for (int i = 0; i < Screen.getNumberScreens(); i++) {
        screen = Screen.getScreen(i);
        try {
            screen.find(getImage(CH_AUTH_REQ_IMG));
            screen.find(getImage(CH_USERNAME_IMG));
            screen.click();
            screen.type(username + Key.TAB);
            screen.type(password + Key.ENTER);
            break;
        } catch (FindFailed e) {
            log.error("Unable to find image on screen: {}", iscreen.getID());
        } catch (IOException e) {
            log.error("Unable to process basic browser authentication for {}", browser, e);
        }
    }

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.