Ranorex not interacting with controls consistently

Class library usage, coding and language questions.
balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Ranorex not interacting with controls consistently

Post by balajichandan » Tue Apr 14, 2009 12:39 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Wed Apr 15, 2009 6:16 pm

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

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Post by balajichandan » Thu Apr 16, 2009 8:00 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Thu Apr 16, 2009 1:00 pm

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