Page 1 of 1

Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Mon Jan 27, 2014 9:20 pm
by hnporter
The app I am testing loads a treeview on the left-hand side. The treeview contains a number of links that, when selected, populate the rest of the UI with the associated config page. A number of these links contain expanders that reveal additional links when expanded, or in some cases additional nested expanders. When the page first loads (and all the expanders are closed), all of the treeview elements fit on the page. However, when they are all expanded, elements on the very top end up hidden, with an associated scrollbar becoming visible. Unfortunately, when Ranorex attempts to click a link that is outside the scrollbar area, I get this error:

Failed to move to location 'Center' within element '{Text:About}'.
The pointer cannot be moved to point '{X=61,Y=-340}' since it is outside of the visible desktop.

I should also mention that if I call the repository items directly from the code using repo (e.g. repo.MyApp.MyLink.click() ) it works fine and scrolls to the necessary element automatically. It's only when passing the XPath from my spreadsheet does this occur (Mouse.click(varAdminLink), where varAdminLink contains the XPath of the item in question). But because I've been told that I cannot pass the repo element via spreadsheet like I can with the XPath, I am forced to try it this way.

Is there some way to have Ranorex auto-scroll for these page elements, when they fall outside the scope of the scrollbar? Basically, my test case will only do two things (repeated for many iterations):

1) click link
2) validate page header loads

I want to keep this as generic as possible (only one test case, using a spreadsheet to iterate through the links), and not have to apply any special handling events or custom behavior that will only load a certain # of links, etc. Thanks in advance for any advice you might provide.

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Thu Jan 30, 2014 6:36 pm
by Support Team
Hello hnporter,

May I ask which Technology is used in your application (for example, WPF, WinForms, WEB, ...).
Have you already tried to add an "Ensure Visible" action or a "Invoke Action" (Focus) action before the click action?
Additionally can you provide a Ranorex Snapshot file?
Please read the section "Creating Ranorex Snapshot Files" in our user guide in order to get a detailed description how to create a Ranorex Snapshot file.

Regards,
Bernhard

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Thu Jan 30, 2014 8:02 pm
by hnporter
The app is WPF with SQL on the back end. I did try EnsureVisible, though it's possible I am misunderstanding its intended usage. The code looks like:

Ranorex.Text myTest = varAdminLink;
myTest.EnsureVisible();
Mouse.Click(varAdminLink);

It does appear that EnsureVisible returns FALSE for the element it can't locate, but it goes no further than that. Is it supposed to handle it in any additional way?

As for a snapshot, I would be happy to oblige; a couple of questions, though - 1) what exactly did you want a snapshot of? It's my understanding that I take a snapshot from within Ranorex Spy...did you want a snapshot of the app in question? And 2) did you want it just attached as a reply to this thread?

Thanks again!

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Tue Feb 04, 2014 7:51 pm
by hnporter
Anything additional on this? I replied to support's requests, but have heard nothing additional. Thanks!

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Wed Feb 05, 2014 4:39 pm
by Support Team
Hello hnporter,

Thank you for the information. I need a snapshot because there are a lot of additional information about your application under test. We can also have a remote session in order to analyze the issue in more detail on your machine directly.
Please send an email to [email protected] in order to arrange an appointment for the remote session.

Regards,
Bernhard

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Thu Feb 06, 2014 2:14 pm
by hnporter
Please see my additional questions in the earlier response - 1) what exactly did you want a snapshot of? It's my understanding that I take a snapshot from within Ranorex Spy...did you want a snapshot of the app in question? And 2) did you want it just attached as a reply to this thread?

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Fri Feb 07, 2014 5:59 pm
by Support Team
Hi hnporter,

Yes, I would say that you can send a snapshot of the whole application.
If you don't want to post it to the forum you can also send an email to [email protected].

Regards,
Bernhard

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Thu Feb 13, 2014 7:45 pm
by hnporter
Apologies for the delay in response. I've sent the snapshot to the support email, please let me know if there's anything else you need. Thanks again!

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Thu Feb 20, 2014 8:02 am
by xiaoyuandlg
I've got into the same question.

Re: Ranorex cannot click link that is "hidden" due to scrollbar

Posted: Mon Feb 24, 2014 5:28 pm
by Support Team
Hi xiaoyuandlg,

Unfortunately we could not resolve the issue until now. Can you please post a Ranorex Snapshot of your application?

Regards,
Bernhard