Migrating Java Selenium Scripts to Avo Assure
This section explains how to migrate Selenium automation scripts written in Java 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.
Known Limitations
The maximum supported size for a ZIP file is 50 MB.
Migrating Selenium Scripts
To migrate your Java 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.
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:
On the Home page, go to Utilities and select the Migrate To Avo tab.

On the Selenium to Avo page, select Java as the programming language from the Select Technology dropdown.
Select Download to save the intercept package file (java-intercept.zip) to your local machine.

Extract the downloaded java-intercept.zip file.
Copy the extracted intercept folder into your Selenium project’s Java source directory (the directory that contains your Selenium framework classes). For Example, <Path to your Selenium project>/src/main/java OR <Path to your Selenium project>/src/test/java.
Note: The intercept folder must be placed inside a Java source root to ensure it is included during project compilation.

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:
Note: This configuration is a one-time setup.
Enabling WebDriver Interception
In the BrowserFactory.java file where the WebDriver is initialized (for example, in a factory class, base class, or any custom setup file), update the driver configuration to use InterceptWebDriver.
1. Add the following import statement to the file:
Locate the line where the browser driver is instantiated (for example, new ChromeDriver() or new FirefoxDriver()) and replace it with InterceptWebDriver.
If you are using driver options:
b. If you are not using driver options:
Note: Ensure that every WebDriver instantiation in your project uses InterceptWebDriver. This applies to all browsers, file names, and initialization methods.
How It Works?
InterceptWebDriver works along with your existing Selenium driver and captures the actions performed in the browser during execution. It does not change your test scripts. It only records the actions so they can be migrated to Avo Assure.
Updating testRunner Configuration
On the Editor, open testRunner.java.
Add
"intercept"to the glue parameter.Update the glue variable as shown below:
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.
Enabling Data Parameterization
Add the following code snippet to the setTestData function in your common Excel data reader file (such as CommonStepsForTestDataReader.java):
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:
Execute your Selenium automation suite.
Note:
The execution generates a selenium_testcase_batch.zip file at the following location: <Project Path>/target/avo_intercept_output.
The ZIP file name must follow the format selenium_testcase_batch.zip. File names such as selenium_testcase_batch1.zip or selenium_testcase_batch2.zip are supported. Randomly named ZIP files are not allowed and will fail validation.
Go to the Selenium To Avo page in Avo Assure.
In the Select Project dropdown, select the Avo Assure project where you want to import the Selenium test cases.

Upload the selenium_testcase_batch.zip file generated in step 1.
Note: The uploaded ZIP file must contain only JSON files. Other file types are not supported.

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

On the Migration Status dialog, the following details are displayed:
Element Repository Folder and Test case Folder name.
Test case Name and migration Status.
Status: Shows whether a Test case is SUCCESS, FAILED, or SKIPPED. An Info (i) icon displays the reason for each status.
Fail: Migration fails due to an error, such as missing data or missing key in the Test case JSON file.
Success: The Test case migrated successfully.
Skipped: Migration is skipped because the Test case fails during Selenium execution.
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:
Test case name.
Test Step Group name.
Step details, including whether data parameterization is present.
Note: To download the Excel file, the Download link is available only when Data Parameterization is configured in your Selenium code.

Select Ok to close the Migration Status dialog.
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?