Dynamic wait for webElements

Ask general questions here.
satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Dynamic wait for webElements

Post by satishmohan » Thu Apr 07, 2016 1:21 pm

I am not from coding background. How do i wait for a element dynamically which loads with different time everytime. I need to do it through recording option (solution needed in record option and not through code)

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

Re: Dynamic wait for webElements

Post by odklizec » Thu Apr 07, 2016 1:27 pm

Hi,

There is no way to add dynamic wait during recording a test case. However, you can add such action manually.

What you are looking for is WaitFor Exist/NotExists action. Simply open the recording of your choice, then add WaitFor action (from Add New Action combo) to recording table (at appropriate place). Eventually, you can select an element from repository, drag&drop it to action table and from the appeared menu select "Wait For" action.

Hope this helps?
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

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Re: Dynamic wait for webElements

Post by satishmohan » Fri Apr 08, 2016 10:48 am

Hi. Thank you. But this action do not work. The wait for action executes before the element is actually present. As a result the wait command is executed successfully and moves to next command but the required action is not present. In my case i am putting a wait to click on a button which loads dynamically but the click action is performed even before the button is available for click... surprisingly ranorex shows it has waited for element successfully and moves on to click-command

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

Re: Dynamic wait for webElements

Post by odklizec » Fri Apr 08, 2016 12:44 pm

Hi,

I'm afraid, It's hard to say what's wrong without seeing a sample app or at least a Ranorex snapshot of the web app before the button is actually available. And another snapshot, taken after the button appearance. Also I would need to see the xpath you are using for the problematic button in repository.

If the WaitFor Exists finishes before the button is actually available/visible, then my guess is that the xpath behind the element used with WaitFor action is already available in GUI? In other words, the button's xpath is either not unique or the button is already available, just not visible on page?

Try to add @visible='true' to the button xpath (in repo). And before you run the test, try the xpath with Ranorex spy. Just to check if the xpath is unique and if it correctly detects the button when available. It should not detect the button if it's not actually visible.
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

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Re: Dynamic wait for webElements

Post by satishmohan » Mon Apr 18, 2016 12:23 pm

Hi. Sorry for the delay. PFA doc describing the actions required. Also attempted visible=True but do not work as required.

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Re: Dynamic wait for webElements

Post by satishmohan » Mon Apr 18, 2016 12:30 pm

PFA
You do not have the required permissions to view the files attached to this post.

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

Re: Dynamic wait for webElements

Post by odklizec » Mon Apr 18, 2016 12:50 pm

Hi,

Thanks for the document describing your issue. Now please post also the Ranorex Snapshot of your web page, ideally before and after the appearance of the element you want to wait for.

However, looking at the document you've posted, I probably see the cause of your problem.

If I'm not mistaken, the element you are clicking (action row 23) and the one you want to wait for (action row 28) lies in the same CanvasTag2DCanves, which is an image? And there most probably lies your problem! Apparently, the clicked and waited-for elements are not identifiable as separate elements? Which means your only hope is to use Image-based automation/validation. Unfortunately, this is not 100% reliable method, but it's probably the best you can do.

I would suggest you to start with this screencast:
http://www.ranorex.com/support/screencasts.html#c2529

And Image-Based Automation chapter in user guide:
http://www.ranorex.com/support/user-gui ... ation.html
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