Sikuli not identifying right textbox

Asked by Achyuth Pydmarri

I am using Sikuli with java and facing below problem

I have a login screen, where there 2 textboxs 1. username and 2. password. Sikuli allways try to enter username in password field and password in username field.

is there any way i can work with indexs ?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Achyuth Pydmarri
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

what version of SikuliX?

How do you find the textboxes?

Revision history for this message
Achyuth Pydmarri (laracroft007) said :
#2

I am using 2.0.1 and I use screen.type for entering in to textbox.

either the way, I was able to solve the problem, here is the answer

Iterator<Match> matches;
         matches = s.findAll(basePath );
         List<String> login=new ArrayList<String>();
         login.add("username");
         login.add("password");
         int i=0;
         while(matches.hasNext()) {
         System.out.println("in the loop");
         objelementimplementation.i_wait_for_given_seconds("4");
         matches.next().click();
         objelementimplementation.i_wait_for_given_seconds("2");
          matches.next().type(login.get(i));
          i++;
         }

         objscore.useKeyEnter(s);
        }
        catch(Exception e){
                e.printStackTrace();
        }

}