{"__v":1,"_id":"54c5219a2418480d0028a2d8","category":{"__v":3,"_id":"54c51db22418480d0028a2c9","pages":["54c520202418480d0028a2d4","54c5219a2418480d0028a2d8","54c524dcd4928c0d00d98e53"],"project":"54c51c5e2418480d0028a2c0","version":"54c51c5e2418480d0028a2c3","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-25T16:45:38.112Z","from_sync":false,"order":2,"slug":"page-objects","title":"Page Objects"},"project":"54c51c5e2418480d0028a2c0","user":"54c4b05742190d0d00f5fbde","version":{"__v":4,"_id":"54c51c5e2418480d0028a2c3","project":"54c51c5e2418480d0028a2c0","createdAt":"2015-01-25T16:39:58.382Z","releaseDate":"2015-01-25T16:39:58.382Z","categories":["54c51c5e2418480d0028a2c4","54c51da3796aed0d009fc80f","54c51db22418480d0028a2c9","54c51dbd1613c70d00eeacbe"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-25T17:02:18.135Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Page Objects tend to either perform actions or find items on the page. Seleno Page Objects provide a number of Actions and Locators that you can use.\n\n## Navigator\nUsed to perform actions that take you to another page, such as clicking a button or a link, or navigating to a URL. There is a strongly typed option to navigate with a controller expression using routing. Page Objects expose the Navigator class with the `Navigate` property.\n\n    Navigate.To<RegisterPage>(By.LinkText(\"Register\"));\n\n## Page Reader ###\nRead values from the page using view model based strongly typed methods. Page Objects that extend `Page<T>`expose the Page Reader class with the `Read` property. For example, to read all fields into a new instance of the current model type (`T`) in a page you can use the `ModelFromPage` method:\n\n    var model = Read.ModelFromPage();\n\n`Read` is currently only available with the generically-typed page object for now, but if you want this functionality with non-generic page objects (by instead supplying strings for the id) then to add an issue to our Github site so we can prioritise it.\n\n## Page Writer ###\nWrite values to the page using view model based strongly typed methods. Page Objects that extend `Page<T>`expose the Page Writer class with the `Input` property. For example, to write all fields from a model of the current type (`T`) from the form on a page you can use the `Model` method:\n\n    Input.Model(modelInstanceToFillInFormUsing);\n\n`Input` is currently only available with the generically-typed page object for now, but if you want this functionality with non-generic page objects (by instead supplying strings for the id) then to add an issue to our Github site so we can prioritise it.\n\n## Script Executor ###\nIf none of the above meet your needs then you have the ultimate control by executing JavaScript with the Script Executor class. Page Objects expose the Script Executor class with the `Execute` property.\n\n    return Execute.ScriptAndReturn<TReturn>(string.Format(\"$('#{0}').attr('{1}')\",Id,attributeName));","excerpt":"","slug":"actions-and-locators","type":"basic","title":"Actions"}
Page Objects tend to either perform actions or find items on the page. Seleno Page Objects provide a number of Actions and Locators that you can use. ## Navigator Used to perform actions that take you to another page, such as clicking a button or a link, or navigating to a URL. There is a strongly typed option to navigate with a controller expression using routing. Page Objects expose the Navigator class with the `Navigate` property. Navigate.To<RegisterPage>(By.LinkText("Register")); ## Page Reader ### Read values from the page using view model based strongly typed methods. Page Objects that extend `Page<T>`expose the Page Reader class with the `Read` property. For example, to read all fields into a new instance of the current model type (`T`) in a page you can use the `ModelFromPage` method: var model = Read.ModelFromPage(); `Read` is currently only available with the generically-typed page object for now, but if you want this functionality with non-generic page objects (by instead supplying strings for the id) then to add an issue to our Github site so we can prioritise it. ## Page Writer ### Write values to the page using view model based strongly typed methods. Page Objects that extend `Page<T>`expose the Page Writer class with the `Input` property. For example, to write all fields from a model of the current type (`T`) from the form on a page you can use the `Model` method: Input.Model(modelInstanceToFillInFormUsing); `Input` is currently only available with the generically-typed page object for now, but if you want this functionality with non-generic page objects (by instead supplying strings for the id) then to add an issue to our Github site so we can prioritise it. ## Script Executor ### If none of the above meet your needs then you have the ultimate control by executing JavaScript with the Script Executor class. Page Objects expose the Script Executor class with the `Execute` property. return Execute.ScriptAndReturn<TReturn>(string.Format("$('#{0}').attr('{1}')",Id,attributeName));