← Back to team overview

sikuli-driver team mailing list archive

[Question #168984]: Cannot (how to) find text field on browser page?

 

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

I am trying to login into facebook. Hence if one goes to http://www.facebook.com/login.php, you will be presented with Email and Password text fields.

I am doing this in java. It works fine in py file where all I had to do was say type("blahblahblah").

But in java it dosent work. Here is my 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(5000);
                 app.focus();
                 s.highlight();
                 s.wait("img/Email.png");
                 s.click("img/1314124383204.png", 0);
                 s.type("img/1314124383204.png", "test123\t", 0);
                 s.type(null, "password", 0);
                 s.click("img/Login.png", 0);
                }
                catch(Exception e){
                        e.printStackTrace();
                }

        }
}

The image in type is the image of text field box for email. It does not type in the email or password but straight away clicks on Login button. I also tried with s.type(null, "test123\t", 0) but that too dosent work.

Any clues/ideas how to get this working. One thing I will say, its reeeeeally hard to work with Java interfaces for Sikuli.

Appreciate all the help!!!

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