Script ExecutionSetting Up and Executing Web Test Automation Scripts in Command Prompt with Maven

Setting Up and Executing Web Test Automation Scripts in Command Prompt with Maven

This article helps you in setting up and executing scripts generated by algoQA.

Prerequisites

Before executing the scripts on a Windows operating system to open your preferred application, ensure that you have performed the following. If Java and Maven are already installed on the system, you can skip the prerequisite steps related to their installation and configuration. Proceed with the steps for running the scripts.

To configure Java and Maven, refer to the article Installation steps for Java Selenium Framework.

Executing Selenium Scripts in Command Prompt on Windows Operating System

Perform the following:

  • Download and extract the script to your local folder. Navigate to the same folder.
  • In the folder navigation bar, type cmd and press 'Enter' to view the Command Prompt screen.
  • Run the following command to trigger the script:
    mvn test
    
    This command will execute the script using Maven, as shown:
    Terminal window with mvn test command highlighted and Maven build output
  • Wait until the Build Success message is displayed, which indicates that scripts have been executed successfully.
    Terminal output showing Tests run 1, Failures 0 and BUILD SUCCESS message
  • You can view the respective report in the Output folder, as shown:
    File explorer listing project files with the output folder highlighted
  • Reports will be generated in Spark and PDF formats, as shown:
    File explorer showing PdfReport and SparkReport folders created today
  • The sample PDF report is shown in the attached image. 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: Screenshots for each verification step.
      Cucumber Report showing Features, Scenarios and Steps pass counts in green donut charts