WaitForDocumentLoaded() Method and ElementNotFoundException
Posted: Thu Oct 15, 2009 8:35 am
Hello,
our company is evaluating Ranorex for Website (our created Websites, Webshops) GUI Tests . It´s a fine tool and most tests run well, BUT there is a main problem that occurs often.
I use WaitForDocumentLoaded(); after every performClick() method. But Ranorex dont wait long enough for the Page, so i get an ElementNotFoundException. The other Option is to use Delay.Ms();, but it´s not a good solution. So why does WaitForDocumentLoaded() not work correctly all the time. Sometimes it works, but when the page needs too much time for loading, the method doesnt work.
Example:
The Problem is that WebDocumentWarenkorb_Minus_Zeitschr wasnt found. if i use delay instead of repo.WebDocumentWarenkorb_Minus_Zeitschr.Self.WaitForDocumentLoaded(); it works. Sometimes it also work with WaitForDocumentLoaded() @ this example. Itßs a strange behaviour.
Thx for the help
our company is evaluating Ranorex for Website (our created Websites, Webshops) GUI Tests . It´s a fine tool and most tests run well, BUT there is a main problem that occurs often.
I use WaitForDocumentLoaded(); after every performClick() method. But Ranorex dont wait long enough for the Page, so i get an ElementNotFoundException. The other Option is to use Delay.Ms();, but it´s not a good solution. So why does WaitForDocumentLoaded() not work correctly all the time. Sometimes it works, but when the page needs too much time for loading, the method doesnt work.
Example:
Code: Select all
repo.WebDocumentZeitschriften_Abopool.Warenkorb.PerformClick();
repo.WebDocumentWarenkorb_Minus_Zeitschr.Self.WaitForDocumentLoaded();
Report.Info("Es wird überprüft, ob die Zeitschrift '" + s + "' im Warenkorb liegt");
ImgTag InhaltWarenkorb = repo.WebDocumentWarenkorb_Minus_Zeitschr.SomeDivTag.FindSingle(".//img[@title='" + s + "']");
Thx for the help