Page 1 of 1

Enter a value in a textbox.

Posted: Tue Oct 26, 2010 10:29 am
by MaxDecimus
Hello, I have the following problem:
I’d like to enter a value in a textbox. That would normally be no problem, but I need to scroll down to the textbox. The scroll action is implemented and works. But instead of writing the value in the textbox, the scroll indicator jumps back, so that the textbox is invisible again. Ranorex doesn`t enter the value and doesn’t throw a RanorexException.

In an older Ranorex version (before 2.3), my program worked.

Code:
Text txtElement = new Text(absolutRanorexPath.ToString());
txtElement.DoubleClick();
Ranorex.Keyboard.Press(“123”);
Ranorex.Keyboard.Press(System.Windows.Forms.Keys.Return);

I tried to solve the problem with the Focus()-, EnsureVisible()- or MoveTo()-method, but without success.
Can anybody help me?

Re: Enter a value in a textbox.

Posted: Tue Oct 26, 2010 3:52 pm
by Ciege
If EnsureVisible isn't working for you then you can try checking the .visible state of the text box. If it is not visible then write some code yourself to scroll until it is visible. You can extend that to check what direction it needs to scroll (i.e. if is off left, or off down, etc..) then you can parameterize that method and make it a framework function that will ensure any object you want is visible and scrolled to.

Re: Enter a value in a textbox.

Posted: Tue Oct 26, 2010 9:33 pm
by Support Team
It seems like the EnsureVisible method is not working for that textbox control. Could you post a snapshot of the application or, even better, a sample application which we can reproduce the problem with?

Anyway, if you implemented the scroll action yourself, there is no need for using EnsureVisible. So I recommend setting the "Use Ensure Visible" property of the repository item or adapter for that textbox to "false". That way Ranorex will not try to make the textbox visible - which seems to fail by scrolling the container to a wrong position.

Regards,
Alex
Ranorex Team

Re: Enter a value in a textbox.

Posted: Thu Oct 28, 2010 12:33 pm
by MaxDecimus
Thank you for responding so quickly. Sadly, it still doesn`t work.
...Alex could you send me your email address? I thnik this will be the best way.

Best regards

Re: Enter a value in a textbox.

Posted: Thu Oct 28, 2010 1:23 pm
by Support Team
Just sent us an email to [email protected]

Regards,
Peter
Ranorex Team