Unable to set WaitForDocumentLoaded() Wait Duration

Ask general questions here.
gblyon
Posts: 5
Joined: Thu May 21, 2015 11:42 pm

Unable to set WaitForDocumentLoaded() Wait Duration

Post by gblyon » Wed Feb 24, 2016 10:07 pm

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.

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

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by odklizec » Thu Feb 25, 2016 12:19 pm

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.
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

gblyon
Posts: 5
Joined: Thu May 21, 2015 11:42 pm

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by gblyon » Thu Feb 25, 2016 8:33 pm

Search Timeout is already set to 30000 ms. Any other ideas?

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

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by odklizec » Fri Feb 26, 2016 8:06 am

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.
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

gblyon
Posts: 5
Joined: Thu May 21, 2015 11:42 pm

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by gblyon » Wed Mar 16, 2016 9:37 pm

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

bpdyna
Posts: 13
Joined: Wed Mar 30, 2016 2:11 pm

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by bpdyna » Fri Jun 10, 2016 1:54 pm

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?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by krstcs » Fri Jun 10, 2016 2:01 pm

What version of Ranorex are you using?
Shortcuts usually aren't...

gblyon
Posts: 5
Joined: Thu May 21, 2015 11:42 pm

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by gblyon » Tue Jun 14, 2016 6:11 pm

6.0

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

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by Support Team » Thu Jun 16, 2016 1:59 pm

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
.
Image

gblyon
Posts: 5
Joined: Thu May 21, 2015 11:42 pm

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by gblyon » Sat Sep 30, 2017 3:48 am

Has this ever been fixed by Ranorex?

ahoisl
Certified Professional
Certified Professional
Posts: 125
Joined: Fri Sep 07, 2007 8:16 am

Re: Unable to set WaitForDocumentLoaded() Wait Duration

Post by ahoisl » Sun Oct 01, 2017 10:27 pm

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