Executing Web Automation scriptsExecuting Web Automation Scripts for Java Selenium Framework

Executing Web Automation Scripts for Java Selenium Framework

Compile, execute, and view reports for web automation scripts generated using the Java Selenium framework in algoQA.

View and Compile Generated Scripts

After generating scripts in algoQA, review and compile them to check for syntax errors and resolve any build failures before execution.

  1. Once the scripts are generated, Navigate to Test Scripts to view the scripts.
    Scripts folder showing generated test scripts with framework, compilation status, and creation date
  2. This page allows you to view scripts along with their framework, compilation status, creator, and creation date and time. From this page, you can also execute, download, or delete the scripts. To execute scripts in algoQA, refer to Online Script Execution.
  3. Once the script is generated, compile it by selecting Compile on the Script Generated Successfully screen.
  4. The Script Editor screen appears, and the script begins compiling. The system checks for syntax errors during this process. If errors are found, Compiled Log Details shows a Build Failure status. If no errors are detected, the build passes.
    GeneratedScript file tree with Compiled Log Details showing BUILD SUCCESS and CodeBot panel
  5. If the build fails, check Compiled Log Details to find the exact step and file path where the error occurred. Navigate to that path, update the parameters causing the issue, and then click Compile to recompile.
    GeneratedScript page with compilation status icon highlighted next to ScriptGeneration folder entry
  6. You can also view the compilation status on the Test Scripts screen.
    Test Scripts screen showing compilation status for generated scripts

Execute Scripts on Windows

Download the compiled scripts and execute them locally using Maven on a Windows machine.

  1. Navigate to the generated script folder, and click the download icon to download the script.
  2. Download and extract the script to your local folder. Navigate to the same folder.

    You'll find the feature files in the scripts folder which you selected before generating scripts.

  3. In the folder navigation bar, type cmd and press Enter to open the Command Prompt.
  4. Run the following command to trigger the script:
    mvn test
    
  5. This command executes the script using Maven.
    Terminal window with mvn test command highlighted and Maven build output
  6. Wait until the Build Success message appears, which indicates that the scripts have executed successfully.
    Terminal output showing Tests run 1, Failures 0 and BUILD SUCCESS message

Framework Capabilities

The Java Selenium framework in algoQA includes the following built-in capabilities that require no custom actions:

For Web Automation with the Java Selenium framework, there is no need to create custom actions for the following capabilities, as they are handled automatically by the framework during execution.

  • Auto Scroll: Automatically scrolls an element into view before performing any action, eliminating the need to add explicit scroll steps.
  • Auto Wait: Automatically waits until an element is visible, enabled, stable, and ready for interaction, removing the need for explicit wait statements.
  • Wait Optimization: Efficiently utilizes the configured wait timeout by continuously checking for element readiness and proceeding as soon as the element becomes available, instead of waiting for the entire timeout period. This improves execution speed. The wait timeout can be configured in the Application Settings.
Application Settings dialog showing the configurable wait timeout value

View Reports

After execution, review the generated reports to analyze test results.

  1. You can view the corresponding report in the Output folder.
    File explorer listing project files with the output folder highlighted
  2. Reports are generated in Spark and PDF formats.
    File explorer showing PdfReport and SparkReport folders created today
  3. The sample PDF report is shown below. It includes the following details:
    • Test Results: Number of test cases that passed and failed.
    • Execution Time: Total duration taken to execute features, scenarios, and steps.
    • Step Details: You can view preceding information for each test step by clicking the feature name link.
    • Screenshots: You can also view screenshots for each verification step.
    Cucumber Report showing Features, Scenarios and Steps pass counts in green donut charts