Selenium To Avo

The Selenium To Avo feature helps you to migrate existing Selenium automation scripts into Avo Assure Test cases.

Prerequisites

Before you migrate Selenium scripts to Avo Test cases, make sure the following requirements are fulfilled:

  • Selenium Environment: You must have a configured Selenium development environment (such as Eclipse) to execute the scripts.

  • Intercept Setup: You must set up the interceptors in your project.

  • Script Status: Your Selenium automation scripts are up to date.

  • Error-free Execution: Ensure the Selenium script runs successfully without any errors before using it in Avo Assure.

  • Avo Assure Access: You must have access to the Avo Assure server.

  • Supported Languages: Avo Assure currently supports Java and JavaScript. You must have Selenium scripts written in one of these languages.

Migrating Selenium Scripts

To migrate your scripts, you must first set up the interceptor in your project, generate the scenario file, and then import it into Avo Assure.

The interceptor allows you to execute code before and after your automation logic without modifying the core functionality of the scripts.

circle-info

Note:

  • During migration, Avo Assure considers only Selenium actions performed on the browser.

  • Avo Assure maps Selenium test data automatically. You should review the migrated data to ensure it is correct.

  • During migration, Avo Assure normalizes all Selenium select actions. The following actions are migrated as selectByValue in Avo Assure:

    • selectByValue

    • selectByIndex

    • selectByVisibleText

Downloading and Configuring Intercept

To download and configure the Selenium scripts to Avo Assure, perform the following actions:

  1. On the Avo Assure Home page, go to Utilities and select the Migrate To Avo tab.

  2. On the Selenium To Avo page, select the programming language used in your Selenium project (such as, Java or JavaScript) to apply the appropriate migration logic.

  3. Select Download to save the intercept package file (for example, java-intercept.zip) to your local machine.

  4. Extract the downloaded java-intercept.zip file.

  5. Copy the extracted intercept folder and place it in the required location within your Selenium project directory. For Example, <Path to your Selenium project>/src/main/java.

  6. Configure the Intercept: Configuring the Intercept allows Avo Assure to capture Selenium browser actions and data parameterization during execution, ensuring accurate migration. To configure the intercept, perform the following actions:

circle-info

Note: This configuration is a one-time setup.

chevron-rightEnabling WebDriver Interceptionhashtag
  1. In BrowserFactory.java file, add the import statement and update the browser initialization line as shown in the following example:

    import intercept.InterceptWebDriver;

    Before: tldriver.set(new ChromeDriver(options));

After: tldriver.set(new InterceptWebDriver(newChromeDriver(options)));

circle-info

How it works?

  • Replacing tldriver.set(new ChromeDriver(options)); with tldriver.set(new InterceptWebDriver(new ChromeDriver(options))); allows the automation framework to monitor and intercept browser actions during test execution.

chevron-rightUpdating testRunner Configurationhashtag
  1. On the Editor, open testRunner.java.

  2. Add "intercept" to the glue parameter.

  3. Update the glue variable as shown below:

    glue = { "steps", "intercept" }

circle-info

How it works?

  • Adding "intercept" to the glue parameter in testRunner.java file instructs the framework where to look for step definitions related to WebDriver interception.

  • By updating glue = { "steps", "intercept" }, the framework can correctly link your test steps with the interception logic, ensuring smooth execution of tests with the new WebDriver setup.

chevron-rightEnabling Data Parameterizationhashtag
  1. Add the following code snippet to the setTestData function in your common Excel data reader file (such as CommonStepsForTestDataReader.java):

    import intercept.AvoHooks; AvoHooks.setExcelData(tableValue);

circle-info

How it works?

  • tableValue is the variable that stores the test data from your Excel sheet. It can have multiple rows and columns, depending on your test.

  • AvoHooks.setExcelData(tableValue) lets the automation framework use this data during the test, so your tests can run with different inputs automatically.

Generating and Uploading Scenarios

To generate and upload Selenium scripts to Avo Assure, perform the following actions:

  1. Execute your Selenium automation suite.

circle-info

Result: The execution generates a scenarios_batch.zip file in your project’s output folder.

circle-info

Note: The scenarios_batch.zip file is generated at the following location:

<Path to your Selenium project>/src/main/java/intercept/output.

  1. Go to the Selenium To Avo page in Avo Assure.

  2. In the Select Project dropdown, select the Avo Assure project where you want to import the Selenium test cases.

  3. Upload the scenarios_batch.zip file generated in step 1.

  4. After uploading the file, select Start Migration button. The Migration Status dialog opens.

  1. On the Migration Status dialog, the following details are displayed:

    • Element Repository Folder and Testcase Folder name.

    • Testcase name and Migration Status.

    • The system provides a downloadable Excel file that contains data parameterization details. Use this Excel file as a reference to review and correct the migrated test cases in Avo Assure, if required. The Excel file includes the following information:

    i. Testcase name.

ii. Test Step Group name.

iii. Step details, including whether data parameterization is present.

circle-info

Note: To download the Excel file, the Download link is available only when Data Parameterization is configured in your Selenium code.

  1. Select Ok to close the Migration Status dialog.

circle-info

Note: After the migration is complete, verify the following:

  • Review the migrated Test cases for accuracy.

  • Verify that the test data is mapped correctly.

  • Manually validate business-critical test scenarios.

  • Data is parameterized only when you enable Data Parameterization. Otherwise, Avo Assure uses hardcoded values.

Last updated

Was this helpful?