Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

MvcPages

Cezary Piątek edited this page May 16, 2017 · 11 revisions

MvcPages

MvcPages is an abstraction layer on selenium driver that provides strongly typed helpers to interact with pages created with ASP.NET MVC framework. In ASP.NET MVC every form is connected with given ViewModel (or DTO, nomenclature doesn't matter). To get hight level of maintanance of views, strongly typed helpers should be used to render forms (Html.EditorFor, Html.InputTextFor etc). It's also a good practice to assign each form an unique id. It's easiest then to create contextual styles and scripts as also spots all places related to given form.

The idea behind MvcPages is to used the same set of good practices from creating maintainable forms to create maintainable UI tests.

No more "StaleElementReferenceException"

Most of the BrowserAdapter methods wrap under the hood IWebElement into StableWebElement which protects against StaleElementReferenceException. When the original reference is lost (for example given element was re-rendered or replaced by new one) StableWebElement tries to reclaim reference to given element. It fails only when the element was completely removed or the locator is not valid anymore.