Forum Discussion
Hi,
It would help to see a sample of your keyword test with the associated error to get better idea of what might go in unexpected way in your case.
But in general, the situation is like this:
-- Yes, .WaitXXX() methods must work for both, scripts and keyword tests;
-- page.Wait() waits for the page to be loaded within either specified or default time interval. Note, that the page is considered to be loaded when complete response for the initial page request was obtained from the server. However, it may take additional noticeable time for the browser to parse and render the obtained page. Especially, if it contains a lot of scripting with a lot of computing-intensive calculations. Besides that, all additional requests sent from the page (Ajax or triggered by script code) are not counted while waiting for page load. (And this is correct.) All the above means that in addition to page.Wait() call, you might need to explicitly wait until this or that element appears on web page;
-- .WaitXXX() methods work only when the object is sought for for the first time (i.e. when test code obtains the reference to it). After that, the object is 'cached', regardless of whether it was found or not, and the obtained result is used further in the code until the same object is sought for again (if needed);
-- As for the error you are mentioning - "WebPageA" does not exist - it looks like that test code either did not obtain the reference to the tested page (this is assumed to be done before the WebPageA.Wait() call), or the tested web page was reloaded and this invalidated the initially got reference to it.
If the above does not help you then it would be nice to see your test and test log as I already wrote.
- BigBear8 years agoOccasional Contributor
AlexKaras, these are good information to know. Thank you very much.
I couldn't find a good example to post now. Next time when I encountered one, I will post an example. Usually it is when the web site is slow or when clicking on a button and the site is spinning (when processing the information) for a while before returning a result page.
I also noticed something here:
Wait method:
WaitTime, Default value = -1 (the documentation does not tell you what -1 means here)WaitProperty method:
If WaitTime is -1, the waiting time is specified by the Auto-wait timeout project property.WaitChild method:
If WaitTime is -1, the waiting time is infinite.WaitAliasChild method:
WaitTime, Default value = 0
If WaitTime is -1, the waiting time is specified by the Auto-wait timeout project setting.When you give -1 for these methods, their meanings are different in each one. SmartBear is so inconsistent in the default values and the meanings of the default values.