Hi Team,
My next project is using Ranorex and I am trying to learn this using the evaluation version.
Coming to the issue, I am trying to select an item in a e-commerce website that it present like two pages(scroll down) from the home page.
I scrolled down to the element and then located the element in spy as in below screenshot.
After this the Spy is always able to highlight the element even if I scroll up or down.
Now, if I close the browser session and launch a new session and navigate to the same page, Spy is unable to locate the item. Please note I have not scrolled down.
Does Spy always require me to scroll down to bring the element in focus to re-link the object?
And the second question - How to perform the scroll down until the element is visible and perform the click?
I have searched the forum, and tried the below piece, but the itemAdapter return null if the object is not in focus. Please provide any help possible on this matter.
public static void ScrollToElementAndClick(RepoItemInfo repoInfoElement){
if (repoInfoElement != null){
Ranorex.Unknown itemAdapter = repoInfoElement.CreateAdapter<Ranorex.Unknown>(false);
do {Keyboard.Press("{Next}");
} while (itemAdapter.Visible == false);
itemAdapter.Click();
}
}
Ranorex spy unable to locate element without scroll
-
- Posts: 2
- Joined: Sun Apr 12, 2020 7:58 am
Ranorex spy unable to locate element without scroll
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex spy unable to locate element without scroll
Hello rahulnair87,
Ranorex has a built-in function that will attempt to ensure the element is visible before performing the actions on it. This means Ranorex if allowed by the technology will automatically scroll to the element so it is visible. I navigated to the webpage in your screenshots and performed a few tests to ensure everything was working fine and could not reproduce the issue you are seeing. If you could please provide some additional information such as:
- Browser including version
- Ranorex snapshot of the browser on the page with the element in question. - https://www.ranorex.com/snapshot
I also witnessed several items changing on the homepage so I would also verify the loafers being tracked are still being displayed on the page.
Regards,
Sean
Ranorex has a built-in function that will attempt to ensure the element is visible before performing the actions on it. This means Ranorex if allowed by the technology will automatically scroll to the element so it is visible. I navigated to the webpage in your screenshots and performed a few tests to ensure everything was working fine and could not reproduce the issue you are seeing. If you could please provide some additional information such as:
- Browser including version
- Ranorex snapshot of the browser on the page with the element in question. - https://www.ranorex.com/snapshot
I also witnessed several items changing on the homepage so I would also verify the loafers being tracked are still being displayed on the page.
Regards,
Sean