Invalid webdocument

Ranorex Spy, Recorder, and Studio.
seurrep
Posts: 17
Joined: Tue Aug 07, 2018 10:19 am

Invalid webdocument

Post by seurrep » Wed Oct 03, 2018 12:29 pm

When I run tests locally - which includes creating a test user via an API then authorising them using a webpage - the tests run without any problems.

When I run them remotely however the part of the test plan that goes to the website to authorise the user repeatedly starts adding this to the log:
WebDocument has become invalid while waiting for WebDocument to be loaded.
For clarity's sake I should add that I create a web browser window at the start of the test run then repeatedly use it rather than repeatedly recreate a browser window. That browser window is used a number of times successfully before this error starts appearing, and when it does Ranorex is basically executing the exact same recording to authorise the user that has been used in previous steps without any issue. I should also add that this problem appears to occur at the point the initial web page is loaded before subsequent actions are performed.

Any clue as to what could be causing this?

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

Re: Invalid webdocument

Post by odklizec » Wed Oct 03, 2018 12:49 pm

Hi,

Could you please shows us the steps preceding the failure (and the step where it fails)? Have you tried to disable "Use cache" for given DOM element?
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

seurrep
Posts: 17
Joined: Tue Aug 07, 2018 10:19 am

Re: Invalid webdocument

Post by seurrep » Fri Oct 05, 2018 3:28 pm

Probably not that easily as I'm not sure my employer would want me to do that.

In any case I think I might be getting a better understanding of what may be going on: it would seem that - contrary to my assumptions - that the VM being used for the tests does not have the IE addon installed (nor had the IE options been updated).

How do I go about installing just the addon for IE on a VM where a full-blown copy of Ranorex isn't installed and is unlikely to ever be installed?

Thanks for the help by the way.

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

Re: Invalid webdocument

Post by odklizec » Fri Oct 05, 2018 3:48 pm

Hi,

I’m not quite sure IE add on has anything to do with this issue? Unlike in other browsers, Ranorex should work just fine without installed/enabled IE addon. It will just identify the elements slower, but that’s it.

May I ask why it’s not possible to install Ranorex on that machine? In my opinion, it’s the best way to assure there are installed all pre-requisites. And you see, at some point in time, you will have to debug something on the VM anyway ;) I’m personally always developing my tests on the VMs, where the test will be running. It’s the best way to assure the tests are optimized for given machine. And you don’t have to worry that the VM will be consuming Studio license, while running the test. In license manager, you can easily specify, which license should be used on the VM. So there is nothing to worry about ;)
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

seurrep
Posts: 17
Joined: Tue Aug 07, 2018 10:19 am

Re: Invalid webdocument

Post by seurrep » Mon Oct 08, 2018 6:36 pm

Not sure if this is relevant but the tests are being run on an Azure based VM.

When I run the tests remotely it can't find the elements according to the log. When I record it again locally using the same browser used remotely (in case the structure has changed in the meantime - part of the test involves using a 3rd party site) it not only finds them but just assigns items that have already been defined to the relevant actions.

Where IE is concerned (we're using IE 11 btw) the slowdown in the past has been sufficient in some cases to stop the tests from running. It's possible I suppose that some of the paths to the elements could do with refining.

Thanks for the response though. Help is much appreciated.

seurrep
Posts: 17
Joined: Tue Aug 07, 2018 10:19 am

Re: Invalid webdocument

Post by seurrep » Fri Oct 12, 2018 11:05 am

I think I've fixed it.

A stupid mistake really. Running locally I had IIS running but remotely I didn't. This seemed to result in a default IIS error page being returned when I was trying to intentionally access a page that didn't exist locally but remotely it was showing a DNS related error. Additionally whilst the browser was showing the URL I was trying to get to when run remotely Ranorex was still seeing the URL of the previous page when getting the URL from the browser (using IE in case that makes any difference)

Thanks for trying to help though. Much appreciated.