How to horizontal scroll to locate specific text

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Neel72
Posts: 4
Joined: Fri Jun 03, 2011 8:20 pm

How to horizontal scroll to locate specific text

Post by Neel72 » Fri Apr 27, 2012 12:02 am

I have silverlight application for which I am automating the test. I have recognized the Text obejct which I need to click to launch next screen.Manual step is I can use the hoprizontal scroll button to locate the required text and then click on it.
I want to automate this step, requrired Text is not available in the same location every run , so how should I use automation to acheive this task.
Need help as its an urgency. :roll:
Attachments
RanorexIssue.png
RanorexIssue.png (42.94 KiB) Viewed 1328 times

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to horizontal scroll to locate specific text

Post by Ciege » Fri Apr 27, 2012 4:12 pm

I've not done any Silverlight, but have done the same with a standard .NET app.
What you may try it to get the current X/Y coordinates for the element you want to click. Also get the rectangle coordinates for the display portion of the AUT. After some math you can test if the X/Y of the element is outside the bounds of the AUT visible rectangle. If so... scroll the AUT until the X/Y of the element is within the boundary of the AUTs window.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Neel72
Posts: 4
Joined: Fri Jun 03, 2011 8:20 pm

Re: How to horizontal scroll to locate specific text

Post by Neel72 » Fri Apr 27, 2012 6:24 pm

Ciege,
I liked the solution, please review the attached scree shot and let wchih of these show the X and Y co-ordinates.

Thanks
Attachments
Ranorexissue2.png
Ranorexissue2.png (10.33 KiB) Viewed 1318 times

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to horizontal scroll to locate specific text

Post by Ciege » Fri Apr 27, 2012 7:03 pm

Expand the Location and ScreenLocation properties and you should see an X and a Y property.

Location = the X/Y location within the AUT
ScreenLocation = the absolute X/Y location to the screen

You can also check the Visible property to tell if the element is visible or not.

In your case the element IS visible. It is located at 54,18 in respect to the AUT window and 1357,457 in respect to the screen.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Neel72
Posts: 4
Joined: Fri Jun 03, 2011 8:20 pm

Re: How to horizontal scroll to locate specific text

Post by Neel72 » Fri Apr 27, 2012 7:18 pm

Thanks that Helps :D