Page 1 of 1

unable to click the button if resolution is changed

Posted: Fri Jul 09, 2010 2:17 pm
by arun_volam
Hi ,
Can any one let me how to click the button if the resolution is changed.Ranorex is not able to find the adapters which are not in visible area of the screen.

i have written scripts and they are working fine in "1024 by 768 pixels" resolution, when i have changed the resolution to "800 by 600" scripts are not working.

Re: unable to click the button if resolution is changed

Posted: Fri Jul 09, 2010 3:52 pm
by Ciege
So if Ranorex does not automatically scroll the item into view (and I don't see why it would in the case of a button) what you can do is check either the .visible property or the x/y location of the object compared to your screen resolution or your AUT size.
If it is not visible or off screen, get a path to the scroll bars of your AUT and scroll the AUT until the object is visible.

Re: unable to click the button if resolution is changed

Posted: Mon Jul 12, 2010 9:39 am
by Support Team
Hi,

You can also try the following two methods.

Focus method
Tries to set the focus on the element.
http://www.ranorex.com/Documentation/Ra ... _Focus.htm

Ensure Visible
Ensures that the element is visible to the user. This is usually accomplished by bringing the element or one of its ancestors to foreground.
http://www.ranorex.com/Documentation/Ra ... isible.htm

Regards,
Peter
Ranorex Support Team

Re: unable to click the button if resolution is changed

Posted: Wed Jul 14, 2010 6:09 am
by arun_volam
Hi ,

when i am using .visible or .ensure visible it is giving me true even it is not visible.And coming to focus
it is not able to focus the button.

Re: unable to click the button if resolution is changed

Posted: Wed Jul 14, 2010 9:25 am
by Support Team
Hi,

Can you please post the exception message you get?

And please can you post us a Ranorex Snapshot of your button:
http://www.ranorex.com/support/user-gui ... html#c2072

Thanks and Regards,
Peter
Ranorex Support Team

Re: unable to click the button if resolution is changed

Posted: Thu Jul 15, 2010 6:42 am
by arun_volam
Hi,

i am not getting any exception but when i am using ensure visible or visible it is giving me true even it is not visible to user.

I have attached the screen shots please look at them.

and i am using the below code.

Ranorex.Button b = "/dom[@domain='apps.ezprints.com']/body/div/div/div/div/div[3]/flexobject/container[@id='mainViewStack']/container[@id='builderView']/toolbar/container[@id='addToCart']/button[@id='_TemplateWidget_Button2']";

MessageBox.Show(b.EnsureVisible().ToString());
b.Focus();
b.Click();

it is flex element.
can please give any other solution for this problem.

Re: unable to click the button if resolution is changed

Posted: Thu Jul 15, 2010 11:50 am
by Support Team
Hi,

Yes we know about that limitation. We are currently working on a code snippit, which we will provide the user a simply functionality to scroll if EnsureVisible() won't work. I will post you the link when the method is available and tested.

Regards,
Peter
Ranorex Support Team

Re: unable to click the button if resolution is changed

Posted: Fri Jul 16, 2010 1:12 pm
by Support Team
Hi,

Please take a look to following post
http://www.ranorex.com/forum/how-to-scr ... t1521.html

Regards,
Peter
Ranorex Support Team