Migrating from Selenium to testIT WebTester

Note: With selenium page objects I mean page objects as described on these pages:
- https://code.google.com/p/selenium/wiki/PageObjects
- https://code.google.com/p/selenium/wiki/PageFactory
You can download a demo project from our FTP server. This project contains a sample application with Selenium and WebTester tests, to illustrate the changes when migrating:
ftp://ftp.novatec-gmbh.de/testit/demo/testit-webtester-demo.zip
Changes to your page objects:
- Change the parent class of your page objects to PageObject.
- Change every WebElement of your page objects to a PageObject or one of the “out of the box” subclasses (like Button, Textfield, Table etc.).
- Replace the @FindBy annotation with @IdentifyUsing:
- Change the ‘how’ attribute to ‘method’ and choose the appropriate method of identification (ID, CSS, XPATH etc.).
- Change the ‘using’ attribute to ‘value’.
- Move any ‘am I on the right page’ validation code to a method and annotate it with @AfterInitialization.
- Remove all WebDriver fields and page object constructors.
- change all following page initialization to use the PageObject method ‘createPageObject(Class pageClass)‘.
Changes to your tests:
- Replace your initialization of a WebDriver with a call to the BrowserFactory class, giving you a Browser object.
- Change the initialization of page objects to use the PageObjectFactory method ‘createPageObject(Class pageClass, Browser browser)‘.
Since you were already using page objects in your tests, everything else shouldn’t need to changed.
You can get the WebTester documentation and latest developments from the testIT documentation space:
https://documentation.novatec-gmbh.de/display/TESTIT
Maven Repository and Dependency
XHTML
1 2 3 4 5 6 7 8 9 10 11 |
<dependency> <groupId>info.novatec</groupId> <artifactId>testit-webtester-framework</artifactId> <version>1.5.1</version> </dependency> <repository> <id>novatec</id> <name>NovaTec Public Repository</name> <url>http://repository.novatec-gmbh.de/content/repositories/novatec/</url> </repository> |
Recent posts

February 2023
Tioman Gally
Kotlin: How to Do Higher-Order Functions

September 2022
Filippos Vogiatzian & Javier De Haro Rodríguez
Maven beyond mvn clean install

December 2021
Alexander Miller & Sebastian Letzel
Kotlin Assertion Libraries - Atrium

November 2021
Tioman Gally
JUnit5 Custom Extension: ParameterResolver with Kotlin

July 2021
Sebastian Letzel & Alexander Miller
Kotlin Assertion Libraries - Strikt

July 2021
Eberhard Mayer
JIB – Build Docker images for your Java Application without a Docker Daemon
Comment article