Quickly validating a number of elements on the page

Ranorex Spy, Recorder, and Studio.
sdrx
Posts: 7
Joined: Tue Jan 29, 2019 10:15 am

Quickly validating a number of elements on the page

Post by sdrx » Fri Apr 26, 2019 2:27 pm

I am looking to validate a page loads in under 10s. I have navigated to the page and then have code to wait for 10 seconds and after the wait it checks 10 items on the page (because each item loads at different speeds but all must load within 10s).

The issue I am having is that on Chrome Ranorex seems to take minimum of 600ms to find each repository item path. On IE it's even slower at about 1.5s per item.

This then means it's checking the page has finished loading all elements in upto 25s (original 10s wait + upto 1.5s x 10).

My question is, how can multiple items be validated as existing on a page within a certain time frame but not affected by how long Ranorex takes to find them.

McTurtle
Posts: 255
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Quickly validating a number of elements on the page

Post by McTurtle » Mon Apr 29, 2019 6:51 am

Hello sdrx,

Each plugin has its own design much like every browser does. The performance is therefore also different.

Have you already tried to use the WaitForDocumentLoaded InvokeAction with timeout? This will get info from the browser if the whole page has finished loading.
WFDL_timeout.png
WFDL_timeout.png (24.94 KiB) Viewed 114 times
WaitForDocumentLoaded should normally make sure that all elements of your page are already there.

Does this help?

Regards,
McTurtle

sdrx
Posts: 7
Joined: Tue Jan 29, 2019 10:15 am

Re: Quickly validating a number of elements on the page

Post by sdrx » Mon Apr 29, 2019 9:28 am

Thanks for your reply. Unfortunately that doesn't work for the product I am testing. It confirms the page has loaded straight away even when it has not. I'm not sure why, however these items might cause it:

The URL of the page never technically changes, it's all frame-based so the page might always "exist".
The elements on the page that load at different speed do so well after the "spinning circle" load indicator on IE finishes, so it might identify it as loaded when it is not.

I was thinking of constructing some sort of very long string containing all the elements and then having the item.Exists check for that full path in the hope that that may just produce 1x 600ms delay. Any other suggestions would be great.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4912
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Quickly validating a number of elements on the page

Post by odklizec » Mon Apr 29, 2019 9:48 am

Hi,

I'm afraid, that what you are trying to achieve, is more performance-related test and it's not what's Ranorex for. Generally speaking, the ability to quickly find all related elements depends on the quality of xpath and number of available elements. If the xpath is too broad and there is too many elements, it may take some time to find them all. In other words, I would never consider Ranorex for this type of test. There is simply no way to be sure Ranorex finds them all within the expected timeframe. Additionally, without seeing, at very least, Ranorex snapshot (NOT screenshot), and an example of xpath you are using, it's hard to suggest something reliable.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration