Page 1 of 1

Ranorex not interacting with controls consistently

Posted: Tue Apr 14, 2009 12:39 pm
by balajichandan
Hi,
This is Balaji. I am using Ranorex 1.5 licensed version. I face inconsistent issue in using Ranorex. In my application I have automated, I need to input values into an edit box. Our application works on multiple Office versions. When we use same piece of code to input text into edit controls, it works inconsistently. But when I debug the same piece of code it works. Does anybody face inconsistent results with Ranorex?

Posted: Wed Apr 15, 2009 6:16 pm
by Support Team
This could be a focus problem. Try to focus the element:

Code: Select all

element.Select(Selection.TakeFocus);
or the control first:

Code: Select all

control.Focus(); 
element.Select(Selection.TakeFocus);
Jenö
Ranorex Team

Posted: Thu Apr 16, 2009 8:00 am
by balajichandan
I have tried that too. When I run the test case individually it works fine. When I run 100+ test cases it does not work. Moreover we have put this functionality in common function. 2 test cases use this common function.
I tried identifying the OK push button by control as well as element. But it did not help us.

Posted: Thu Apr 16, 2009 1:00 pm
by Support Team
If it usually works, but seldom does not, this could be a timing problem. How do you select the edit box? The best way is to click into the edit box using the mouse. You could also try to wait some time before performing the keyboard input.
By the way, could you post the code you use to send the keyboard input? Please, don't use Control.SendKeys, but the Application.SendKeys method.

Regards,
Alex
Ranorex Support Team