← Back to team overview

sikuli-driver team mailing list archive

[Question #168981]: Java: Clicks but does not type?

 

New question #168981 on Sikuli:
https://answers.launchpad.net/sikuli/+question/168981

I am trying to click in the browser url window and type an address. For some reason it clicks on the image (for the url) but that fails to type complaining, image not found.

Here is the code:

import org.sikuli.script.*;

public class T1 {

        public static void main(String[] args) {
                Screen s = new Screen();
                try{
                 App app = new App("C:\\Users\\rmisra\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe");
                 app.open();
                 Thread.sleep(2000);
                 app.focus();
                 s.highlight();
                 s.click("img/WWWgOOgICOfT.png", 0);
                 s.type("img/WWWgOOgICOfT.png", "http://finance.yahoo.com";, 0);
                }
                catch(Exception e){
                        e.printStackTrace();
                }

        }
}

And this is what I get on execution:

[info] Windows utilities loaded.
[log] App.open C:\Users\rmisra\AppData\Local\Google\Chrome\Application\chrome.exe(4952)
[log] App.focus C:\Users\rmisra\AppData\Local\Google\Chrome\Application\chrome.exe(4952) #0
[log] toggle highlight Screen(1)[0,0 1920x1080] E:Y, T:3.0: true
[info] Sikuli vision engine loaded.
[log] CLICK on (190,339)
FindFailed: can not find img/WWWgOOgICOfT.png
Line ?, in File ?
        at org.sikuli.script.Region.handleFindFailed(Region.java:349)
        at org.sikuli.script.Region.wait(Region.java:420)
        at org.sikuli.script.Region.find(Region.java:308)
        at org.sikuli.script.Region.getLocationFromPSRML(Region.java:856)
        at org.sikuli.script.Region.click(Region.java:488)
        at org.sikuli.script.Region.type(Region.java:586)
        at T1.main(T1.java:14)

Any ideas why it is able to click but than not type in it? (Same works fine in py script recorded by IDE)

Thanks



-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.