Page 1 of 1

Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Wed Feb 24, 2016 10:07 pm
by gblyon
I am unable to set the wait duration for WaitForDocumentLoaded(). Everytime I run the test, I get the following error:

No element found for path '/dom[@domain='devxxx.xxxxxxxx.com']' within 10s.
Show/Hide Stacktrace
at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout) at Ranorex.WebDocument.op_Implicit(String path) at RV.RV.RVSANewContactsDefaults01LoginIEDev.Run() at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)

When I try to set the wait duration to 60 seconds as follows:

Public longTimeOut As Ranorex.Duration = 60000 '60 sec wait
arg = "{Window Definition}"
My.webDoc = arg
My.webDoc.WaitForDocumentLoaded(longTimeOut)

I get the same message. What am I missing?

Running Ranorex v5.4.5 on various OS and Browser combinations. Happens on all of them.

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Thu Feb 25, 2016 12:19 pm
by odklizec
Hi,

I guess you reduced the SearchTimeout of DOM element (in repository) to 10 secs? Try to increase the Search Timeout to 30 (or more secs). Apparently, if Search Timeout is set too low, WaitForDocumentLoaded is not helpful, because DOM is not yet available at a time of WaitForDocumentLoaded initialization? Hence it fails, no matter how long you set WaitForDocumentLoaded duration.

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Thu Feb 25, 2016 8:33 pm
by gblyon
Search Timeout is already set to 30000 ms. Any other ideas?

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Fri Feb 26, 2016 8:06 am
by odklizec
Hi,

Are you sure the DOM repo element Search Timeout is 30sec and you still getting this error?...
No element found for path '/dom[@domain='devxxx.xxxxxxxx.com']' within 10s.

If it fails with 10sec error, then there must be 10sec search timeout? Either this, or you changing the Search Timeout somewhere in code?

Could you please post the exact action it fails with? Ideally, post the entire solution (or at least Recording/Code module + repository) it fails with.

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Wed Mar 16, 2016 9:37 pm
by gblyon
Here's the additional detail you requested.

No element found for path '/dom[@domain='devrvsa.reversevision.com']' within 10s.
Show/Hide Stacktrace
at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout) at Ranorex.WebDocument.op_Implicit(String path) at RV.RV.RVSANewContactsDefaults01LoginChromeDev.Run() at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)

arg = "/dom[@domain='"+tsys+"rvsa.reversevision.com' and @pageurl>'https://"+tsys+"rvsa.reversevision.com/Contacts/Leads']"
TMX.TestPause(1000)
If Not arg.Equals("Panel") Then
TMX.base = arg
If TMX.base.StartsWith("/dom") Then 'web
Dim parts As String() = TMX.base.Split(New String() {"'"}, StringSplitOptions.None)
val = parts(0) & "'" & parts(1) & "']"
If TMX.webDoc is Nothing Orelse Not TMX.webDoc.Equals(val) Then TMX.webDoc = val
If Not parts(3).Contains("*") Then If Not TMX.webDoc.PageUrl.Contains(parts(3)) Then TMX.webDoc.Navigate(parts(3))
TMX.webDoc = arg
TMX.webDoc.WaitForDocumentLoaded(TMX.longTimeOut)
End If
End If

In Global Settings, Settings dialog, Repository Defaults tab values are set as follows:

General
Enable app folder caching = true
Enable folder autogeneration = true

Timeouts for new entries
Search timeout for application folders (ms): = 30000
Search timeout for rooted folders (ms): = 30000
Search timeout for items (ms): = 30000

Code Generation
Repository namespace: = MyTestProject
Repository class name: = New_Repository

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Fri Jun 10, 2016 1:54 pm
by bpdyna
I am having this same issue. I am testing a web application that goes through a number of different pages, where each is identifiable by a unique DOM path. I use the following piece of code:

Code: Select all

public void WaitForDocumentLoaded(string TestEnvironment, string path)
        {
        	WebDocument page= "/dom[@domain='" + TestEnvironment + "' and @path~'" + path + "']";
        	page.WaitForDocumentLoaded(30000);
        }
here TestEnvironment is a global variable depicting the URL.

I have 2 DOM elements in my repository, both have Search Timeout set to 30s which gives an Effective Timeout of 30s.
But every time the web application takes more than 10s to go to the next page, Ranorex fails the test and I get the error: "No element found for path within 10s."

Was there a solution to this issue? where is the 10s timeout set?

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Fri Jun 10, 2016 2:01 pm
by krstcs
What version of Ranorex are you using?

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Tue Jun 14, 2016 6:11 pm
by gblyon
6.0

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Thu Jun 16, 2016 1:59 pm
by Support Team
Hello bpdyna,

Thank you for reporting the issue.
I'm able to reproduce the issue on my side. I'll forward it to our QA team. I hope I can give you an update soon.

Regards,
Bernhard

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Sat Sep 30, 2017 3:48 am
by gblyon
Has this ever been fixed by Ranorex?

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Posted: Sun Oct 01, 2017 10:27 pm
by ahoisl
This is not a Ranorex issue, but an issue in your code :D

When you assign a string or RxPath to an Element or Adapter variable, such a code line implicitly searches for the DOM element using a default search timeout. For example, those were the lines in the post of this thread:
arg = "/dom[@domain='"+tsys+"rvsa.reversevision.com' and @pageurl>'https://"+tsys+"rvsa.reversevision.com/Contacts/Leads']"
WebDocument page= "/dom[@domain='" + TestEnvironment + "' and @path~'" + path + "']";
Instead of such lines causing an implicit search, either use a repository where you can set the timeout or use the Host.Local.FindSingle call to specify a timeout, e.g. in this case with 60 seconds timeout:
WebDocument page = Host.Local.FindSingle("/dom[@domain='" + TestEnvironment + "' and @path~'" + path + "']", 60000);
After the element is successfully found that way, you can then invoke the WaitForDocumentLoaded on it.

Regards,
Alex
Ranorex Team