LeanFT for Selenium is a solution that extends the Selenium API, increasing productivity and enabling you to create more robust and more maintainable Selenium tests.
LeanFT for Selenium includes the following:
An IDE plugin (for Eclipse and IntelliJ IDEA) that provides you with:
IDE project templates for Selenium projects (Java only). By using these templates you can create projects that are ready for Selenium automation.
Easy access to a dedicated Selenium Object Identification Center (OIC). The OIC is a spying tool that enables you to efficiently build WebDriver-based object identifications, validate them, and generate the identification code easily, significantly improving test creation time. For more information, see Object Identification Center for Selenium.
- LeanFT for Selenium is supported on Windows, Linux, and Mac environments.
- LeanFT for Selenium supports running your tests with Selenium Grid.
Log into the LeanFT machine as administrator.
Install the browsers that you will be working with in their default installation locations. For supported browsers for Selenium, see the LeanFT Product Availability Matrix.
Download and extract the Selenium WebDriver drivers relevant for your browsers. See the Selenium website.
- For supported WebDriver drivers, see the LeanFT Product Availability Matrix.
- Firefox requires a WebDriver driver from version 48 and later.
Add the location of the WebDriver drivers to the system environment Path variable.
For example, if your browser driver is located in C:\WebDrivers, add C:\WebDrivers to the Path variable.
Set up Java SDK
The following procedure is relevant only for Java.
Maven-based projects only:
Run the following command to download the relevant JAR files from the LeanFT Java SDK folder to your organization's repository:
mvn deploy:deploy-file -DgroupId=com.hpe.lft -DartifactId=selenium-sdk -Dversion=14.0.0 -Dpackaging=jar -Dfile=<path-to-file> -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> -Durl=<url-of-the-repository-to-deploy>
Run this command for each JAR, using the appropriate values:
JAR Values SDK
Path to file:
- Windows: <LeanFTInstallation>\Selenium SDK\Java\com.hpe.lft.selenium.jar
- Linux: <LeanFTInstallation>/selenium-sdk/Java/com.hpe.lft.selenium.jar
- Mac: <LeanFTInstallation>/Selenium SDK/Java/com.hpe.lft.selenium.jar
Path to file:
- Windows:<LeanFTInstallation>\Selenium SDK\Java\com.hpe.lft.selenium-javadoc.jar
- Linux: <LeanFTInstallation>/selenium-sdk/Java/com.hpe.lft.selenium-javadoc.jar
- Mac: <LeanFTInstallation>/Selenium SDK/Java/com.hpe.lft.selenium-javadoc.jar
Add the following switch to the command: -Dclassifier=Javadoc
Non-Maven based projects:
Download the Selenium JAR files to the LeanFT machine. For details, see Selenium's documentation.
Tip: This can be the Selenium standalone JAR, or the collection of the Selenium Java binding JAR files.
- Create a folder (in any location) for the tests that you will create.
Deploy the SDK to the test folder. Run the following scripts:
OS Script Path Windows js_installation.bat
Note: You must run this script for each test folder that you create.
Install the selenium node module. From the test folder, run the following command:
npm install selenium-webdriver
Create a Java Selenium project
In your IDE, create a new Selenium project using the New Project wizard. For details, see Create a LeanFT testing project.
- Select Selenium.
- For non-Maven-based projects, provide the path to the Selenium JAR files.
The project is created with all the required LeanFT and Selenium libraries.
Implement your test as you would any other Selenium test:
Use the Selenium SDK and the LeanFT Selenium SDK (Java)
The SDK includes an extended set of locators that can:
- Identify elements by their visible text
- Identify input elements by their type
- Identify elements by attributes and styles
- Provide a regular expression as a locator's value
- Identify elements by a combination of locators
To identify (spy) objects in your application and easily generate a description code for this element to be used in your test.