TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

WithMinimumWaitTimeoutOf - does it not apply to every action? #221

Open kjohann opened 8 years ago

kjohann commented 8 years ago

I am setting up my first real test with Seleno (after doing a simple POC), and have run in to something I find a little peculiar. I am doing a test where I fill in a form om a page. After the form is filled in, there is a submit button that is pressed. This essentially refreshes the browser as it does a RedirectToAction back to the same page in the controller action. After pressing the submit button, I would like to press a tab (which is an anchor tag) to go to another page.

However, doing this throws an exception: "stale element reference: element is not attached to the page document". But if I do the navigation like this (the code is from my own BasePage class that inherits Page), I don't get the exception:

var findExpression = By.LinkText(text);
Find.Element(findExpression);
return Navigate.To<TPage>(findExpression);

I also have an issue with the first form page if I click the submit button and then try to fill in another form element before submitting again. The lates submit doesn't seem to happen (almost like the next action, which is the tab-click, overrides the submit).

To me this feels a little confusing.. I thought that when initializing a SelenoHost with a remote web driver, the default implicit wait was 10 seconds? And if it is not, is there a better way to for instance navigate by linktext using an explicit timeout?