Ranorex not interacting with controls consistently : Automation API

Ranorex not interacting with controls consistently

Class library usage, coding and language questions.

Ranorex not interacting with controls consistently

Postby balajichandan » Tue Apr 14, 2009 1: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?
balajichandan
 
Posts: 24
Joined: Tue Apr 14, 2009 1:29 pm

Postby Support Team » Wed Apr 15, 2009 7: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Postby balajichandan » Thu Apr 16, 2009 9: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.
balajichandan
 
Posts: 24
Joined: Tue Apr 14, 2009 1:29 pm

Postby Support Team » Thu Apr 16, 2009 2: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 1 guest