LeanFT for Selenium

Introduction

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:

  • A Java code library that extends the WebDriver API with additional locators and utilities. Using this library, you can create more robust or generic identifications for your objects, and use built-in utilities rather than implementing them at your end from scratch.

  • An IDE plugin (for Eclipse and IntelliJ IDEA) that provides you with:

    • IDE project templates for Selenium projects. Using these templates you can create projects that are ready for Selenium automation.

    • An Object Identification Center. A powerful spying tool that enables you to efficiently build robust WebDriver-based object identifications, validate them, and generate the identification code easily. With that, the test creation time and its robustness dramatically improve.

Note:  

  • LeanFT for Selenium is supported on Windows, Linux, and Mac environments.
  • LeanFT for Selenium supports running your tests with Selenium Grid.
  • LeanFT for Selenium is currently supported at technology preview level.

Back to top

Before you start

  1. Install and configure browsers and relevant Selenium WebDriver drivers

    1. Log into the LeanFT machine as administrator.

    2. 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.

    3. Download and extract the Selenium WebDriver drivers relevant for your browsers. See the Selenium website.

      Note:  

    4. 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.

  2. Maven-based projects: You must, once-off, install the LeanFT JARs to your Maven repository (your organization's or local).

    The JARs are located in:

    • Windows: <LeanFTInstallation>\Selenium SDK\Java\
    • Linux: <LeanFTInstallation>/selenium-sdk/Java/
    • Mac: <LeanFTInstallation>/Selenium SDK/Java/
    JAR Maven build artifact identity (GAV)
    com.hpe.lft.selenium.jar

    groupId: com.hpe.lft

    artifactId: selenium-sdk

    version: 14.0.0

    com.hpe.lft.selenium-javadoc.jar

    groupId: com.hpe.lft

    artifactId: selenium-sdk

    version: 14.0.0

    Add the following switch to the command:
    -Dclassifier=Javadoc

  3. Non-Maven based projects: Download the Selenium JAR files to the LeanFT machine.

    Tip: This can be the Selenium standalone JAR, or the collection of the Selenium Java binding JAR files.

    For details, see Selenium's documentation.

Back to top

Create a Selenium project

In your IDE:

  1. Create a new Selenium project using the New Project wizard. For details, see Create a LeanFT testing project.

    1. Select Selenium.
    2. 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.

  2. 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

    Use the Object Identification Center (OIC) for Selenium

    To identify (spy) objects in your application and easily generate a description code for this element to be used in your test.

Back to top