1

I wants to apply dynamic wait in ranorex.

To open a webpage I used static wait like this :-

Host.Local.OpenBrowser("http://www.ranorex.com/Documentation/Ranorex/html/M_Ranorex_WebDocument_Navigate_2.htm",
                      "firefox.exe");
Delay.Seconds(15);                 

Please provide me a proper solution in details. Waiting for your humble reply.

kkashyap1707
  • 494
  • 2
  • 8
  • 16

2 Answers2

2

The easiest way is use the wait for document loaded method. This allows you to set a timeout that is the maximum to wait, but will continue when the element completes it's load. Here is the documentation on it,

http://www.ranorex.com/Documentation/Ranorex/html/M_Ranorex_WebDocument_WaitForDocumentLoaded_1.htm

theDarse
  • 749
  • 5
  • 13
1

First of all, you should be more detailed about your issues. Atm you actually don't state any issue and don't even specify the reason for the timeout.

I don't actually see why you would need a timeout there. The next element to be interacted with in your tests will have it's own search timeouts. In my experience I haven't had a need or a reason to have a delay for the browser opening.

If you truelly need a dynamic delay there, here's what you actually should validate.

1) Either select an element that always exists on the webpage when you open the browser or

2) Select the next element to be interacted with and build the delay ontop of either of these 2

Let's say that we have a Input field that we need to add text to after the page has opened. The best idea would be do wait for that element to exists and then continue with the test case.

So, we wait for the element to exist (add the element to the repository):

repo.DomPart.InputElementInfo.WaitForExists(30000);

And then we can continue with the test functionality:

repo.DomPart.InputElement.InnerText = "Test";

What waitForExists does is it waits for 30 seconds (30000 ms) for the element to exists. It it possible to catch an exception from this and add error handleing if the element is not found.

The dynamic functionality has to be added by you. In ranorex at one point you will always run into a timeout. It might be a specified delay, it might be the timeout for a repo element, etc. The "dynamic" functionality is mostly yours to do.

If this is not the answer you were looking for, please speicify the reason for the delay and i'll try to answer your specific issue more accurately.

Martin
  • 575
  • 6
  • 13