Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:scripting_state_model [2020/11/24 22:09] – [Activating plugins] admin | tutorial:scripting_state_model [2024/01/02 19:37] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 37: | Line 37: | ||
| - | Besides triggers, scripts are also used for building UI Page Objects, Cucumber style test step definition and MCases, which are out of scope of this tutorial. | + | Besides triggers, scripts are also used for building UI Page Objects, |
| ===== Model triggers ===== | ===== Model triggers ===== | ||
| Line 112: | Line 112: | ||
| | | ||
| + | ==== Web App Automation==== | ||
| For test automation, for example web application you would activate // | For test automation, for example web application you would activate // | ||
| For example: | For example: | ||
| - | | + | |
| - | + | ||
| + | === Page Object=== | ||
| You could also use //PAGES// tab to define page object: | You could also use //PAGES// tab to define page object: | ||
| // | // | ||
| | | ||
| - | def addMainPage () { | + | |
| - | | + | |
| - | elem = mainPage.addElement(' | + | |
| - | elem.addAction(' | + | $SELENIUM.getWebDriver().findElement(elem.locator).click(); |
| - | | + | }) |
| - | }) | + | |
| - | } | + | |
| - | | + | |
| Then in // | Then in // | ||
| | | ||
| + | The advantage of using page objects is that all element locators are organized and managed in one central place for easy maintenance. | ||
| + | === Find Element Locator === | ||
| + | Web element locator can be xpath, css or by id, etc. as supported by // | ||
| + | |||
| + | There are many browser add-on/ | ||
| + | |||
| ===== User variables ===== | ===== User variables ===== | ||