Click on textbox & then use type function will append Some Garbage char in start of text.

Asked by Saorabh Singh

I have a Application,where i need to input some values in text box...

Steps to Achive results:
Image= text box
otp="123456"

-->Search Text box.-------->Region r1 = s.exists(Image,5);
-->click Textbox.------------->r1.click(Image,0);
-->Enter Text------------------>r1.type(Image,otp,0)

expected:
in lst Step..123456 Should be entered in Textbox...
ACTUAL:
But Some Garbage value/char is Appended before Actual text.
Eg. the entered value is---->u123456

is this a bug...
how to Solve this problem

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
Henning Eggers (henninge) said :
#1

I am sorry but you have provided too little context to be able to comment. What language/system are you working on? The question gives no clue at all.

Revision history for this message
Saorabh Singh (kunnu30) said :
#2

Sorry this Question is related to Sikuli...
& i am using Sikuli in my java program.on windows

On Thu, Jun 16, 2011 at 4:20 PM, Henning Eggers <
<email address hidden>> wrote:

> Your question #161633 on Launchpad itself changed:
> https://answers.launchpad.net/launchpad/+question/161633
>
> Status: Open => Needs information
>
> Henning Eggers requested more information:
> I am sorry but you have provided too little context to be able to
> comment. What language/system are you working on? The question gives no
> clue at all.
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/launchpad/+question/161633
>
> You received this question notification because you asked the question.
>

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

**** first a comment on your coding:

-->Search Text box.-------->Region r1 = s.exists(Image,5);
-->click Textbox.------------->r1.click(Image,0);
-->Enter Text------------------>r1.type(Image,otp,0)

-- already the s.exists() returns a match, that you store in r1 - so you should use s.click(r1,0), to avoid the additional find operation.

-- r1.type(Image,otp,0) does a click internally

so your sequence could be:
Region r1 = s.exists(Image,5);
s.type(r1,otp,0);

... and you should check, wether image was found, before firing the type ;-)

**** your question
this might be an effect of your additional click.
If the above recommended code does not help, try paste() instead of type()

Revision history for this message
Saorabh Singh (kunnu30) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
Saorabh Singh (kunnu30) said :
#5

LinkedIn
------------

I'd like to add you to my professional network on LinkedIn.

- saorabh

saorabh singh
QA Engineer at Arcot Systems
Bengaluru Area, India

Confirm that you know saorabh singh
https://www.linkedin.com/e/-xt10ca-gpf0wor1-3d/isd/3346016438/1Kekwdpu/

--
(c) 2011, LinkedIn Corporation