Ranorex

Identify control by coordinates only?

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexRecorder
View previous topic :: View next topic  
Author Message
JeffreyTucker



Joined: 01 Apr 2008
Posts: 2
Location: Newton, MA

PostPosted: Tue Apr 01, 2008 9:46 pm    Post subject: Identify control by coordinates only?
Can the recorder be made to identify a control based upon only its relative window position? We have a problem with a third party control that always changes its attributes (ControlID/role) and displays as an image that is clickable.
Thanks.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 344

PostPosted: Wed Apr 02, 2008 10:27 am    Post subject:
In fact, the RanorexRecorder should already do that if it can't find the control and the corresponding element otherwise.

What do you mean with "always changes its attributes"? Do the attributes change at runtime or after a restart of the application?

Regards,
Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
JeffreyTucker



Joined: 01 Apr 2008
Posts: 2
Location: Newton, MA

PostPosted: Fri Apr 04, 2008 6:14 pm    Post subject: Identify control by coordinates only?
Apparently the control actually does change its attributes at runtime. We can see them change each time we hit the form.
I noticed that you claim that you do not record mouse moves, but only clicks. So I tried to click within the window that has the image control (that is giving us trouble), then clicking the image button. That seemed to work to the point where I could get all the way through a recording session and play it back. Is this a valid way to proceed in this case?


We have an multimedia interview application that locks out the keyboard while the interview is on-going. Only the mouse is allowed. We would like to automate testing with the recorded C# script merged with and driven by NUnit tests. Have you done this sort of thing before?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 344

PostPosted: Mon Apr 07, 2008 1:53 pm    Post subject:
JeffreyTucker wrote:
Is this a valid way to proceed in this case?

Actually, clicking on the control should be sufficient since the RanorexRecorder activates/brings the corresponding form to front before searching for the control. But if it works that way ... Smile

We have a couple of customers using NUnit and Ranorex, and use NUnit ourselves. The one thing you might run into is setting the ApartmentState of the NUnit thread to STA. Usually, NUnit runs the testing thread with an MTA apartment state while Ranorex assumes STA (and requires STA for web automation). So, if you experience problems running you Ranorex scripts via NUnit, configure NUnit to use STA.

An instruction on how to do that can be found here:
http://www.hedgate.net/articles/2007/01/08/instantiating-a-wpf-control -from-an-nunit-test/
The first option is to place a config file in the same directory as you NUnit test library DLL. The second option is to create a new thread with STA in every test method calling Ranorex.

Regards,
Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexRecorder All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum