Is it possible to use WaitUntilReady?

Class library usage, coding and language questions.
Yauchy
Posts: 2
Joined: Fri Nov 01, 2013 6:00 pm

Is it possible to use WaitUntilReady?

Post by Yauchy » Fri Nov 01, 2013 6:14 pm

As any automation tester can attest to there are only 2 issues ever when automating - "waiting & then finding". I just started up the tool, made a basic web test and after many, many attempts I finally got it to run! But there is a problem, it is not waiting long enough before clicking some objects on a page... so things are being skipped.

Now site performance and these objects change in how fast / how slow they load and the only thing you can see as an end user is a "spinning wheel", so you are unsure when it will load. Instead of using hard coded waits or hard coded values based on the type of object, is there some type of wait until ready in your API which can be set for all objects - so that base wait is ignored/overwritten or ready in addition to?

I'm seasoned in Telerik Test Studio and Test Partner, so I'm used to the waiting and interaction problem...but I'm just now trialing your tool and this "wait until ready" at a browser and/or object level functionality is a MUST for me to even remotely give you guys a thumbs up to move forward :)

Here's some of my application info:
Ranorex version: 4.1.2.16100
Browser used: Firefox 25.0

I really, really, really want to avoid hard waits or 'delays' if possible. I can give code if need be, but its just a "login, click 10 links, sign out" basic POC type test case.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Is it possible to use WaitUntilReady?

Post by Support Team » Wed Nov 06, 2013 6:06 pm

Hello Yauchy,

You could try to use the API method WaitForDucmentLoaded() on your web page before perform a click on your objects. Another way would be to use a Validate.Exists() on your elements before you click on it.

Please let me know if this solved your issue.
Thanks in advance.

Regards,
Markus (T)
.
Image

Yauchy
Posts: 2
Joined: Fri Nov 01, 2013 6:00 pm

Re: Is it possible to use WaitUntilReady?

Post by Yauchy » Thu Nov 07, 2013 12:27 am

I added a WaitForDocmentLoaded(); after every Delay.Milliseconds(200); and while it noticeably helped, it did not resolve the skipping of some objects - especially when a large spinning wheel was present on the screen (likely some back end ajax or javascript running something asynchronous).

I'll now attempt to use an existence check, but I am very unfond of hard coding values to look for...but understand its necessity on occasion.

Are there any lower level object-level calls which could be made - element ready, etc?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Is it possible to use WaitUntilReady?

Post by Support Team » Thu Nov 07, 2013 2:16 pm

Yauchy wrote:I'll now attempt to use an existence check, but I am very unfond of hard coding values to look for...but understand its necessity on occasion.
You almost never need any hard-coded delays. You just need to do the same thing, a human user would do, using Ranorex: Wait for the spinning wheel to disappear (e.g. using the "Wait For Not Exists" recorder action) or wait for the UI elements you want to access next to appear (or to get enabled).

I guess the problem with your specific AUT is that the UI controls are already there, but disabled as long as the spinning wheel is shown. If that's the case, you can edit the RanoreXPath of the repository items you want to click and add a "enabled=true" condition (see the RanoreXPath samples in the user guide).

In any case, you would only define a maximum timeout to wait (for the spinning wheel to disappear or for the controls to get enabled), not a hard-coded delay. As soon as your condition is met, Ranorex will go on with the next actions. The following section in the Ranorex User Guide also covers that topic:
http://www.ranorex.com/support/user-gui ... eouts.html

Regards,
Alex
Ranorex Team
.
Image