Need the code to give input to the fields

Asked by shankar ganesh

I am testing POS device through sikuli tool by connecting through the Emulator via windows.
At first instance the login screen appears with the two tabs username and password with the entry box of same kind.
When i execute the following code i am not able to give inputs to these fields

click("1327062380260.png")
type("123")
wait(1)
find("Pusswmrd.png")
type("123")

I doesnt have that much of coding practice....can any one please help me out on this issue.

Question information

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

try this:

click("1327062380260.png"); wait(1)
type("123")
wait(1)
type(Key.TAB) # should go to the password field
type("123")

--- click("1327062380260.png")
make sure, the emulator window has focus and that the resulting click point is inside the entry field (the center of the captured image.

Revision history for this message
shankar ganesh (k-shankar2m) said :
#2

Hi Raiman,

thanks for the reply, but the option type(Key.TAB)is not working.
the cursor is not jumping to the password field in the emulator, is there any other options for this. its giving input as 123 123 in the sername filed itself.

Awaiting for your valuable response.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

Ok, might be - I have no experiences with this emulator stuff ;-)

So you might use the fact, that the password field is below the username field in a specific pixel distance:

click("1327062380260.png"); wait(1)
type("123")
wait(1)
pw = getLastMatch().getCenter().below(50)
type(pw, "123")

--- below(50)
This resulting click point should be somewhere in the password field. You might measure the appropriate distance in the IDE's preview feature or any other tool that shows pixel locations on the screen.

Revision history for this message
shankar ganesh (k-shankar2m) said :
#4

Thanks RaiMan, that solved my question.