Sikuli not identifying right textbox

Asked by Achyuth Pydmarri on 2020-01-17

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Achyuth Pydmarri
Solved:
2020-01-17
Last query:
2020-01-17
Last reply:
2020-01-17
RaiMan (raimund-hocke) said : #1

what version of SikuliX?

How do you find the textboxes?

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();
        }

}