Selenium Test in Azure Pipeline

Reading Time: 4 minutes

It will help you to have a Selenium test in azure pipelines also helps to automatically build, test, and deploy your projects, with Continuous Integration, upon various production environments. So your Selenium automation test scripts can run successfully on Azure Pipeline.

Why we need Azure pipelines for integration

  • We can have an automated way of running our regression test.  Whenever we have any changes to our Version Control System repository and we can have our test run in parallel along with the project build. So that we can identify  any bugs or defects even when there is a small change of functionality or code So that’s the reason we can integrate Selenium test in azure pipelines.


  • Java as the programming language
  • TestNG as the assertion framework
  • Maven as the build tool
  • WebDriver as the browser automation tool
  • IntelliJ as the IDE

Some dependencies we use in this framework

  • To read data from an excel file we need Apache POI maven dependency
  • For testNg.xml dependency
  • For Generating Extent Report dependency

Handle chrome browser in Headless mode

  • The headless option will tell to Google Chrome to execute in headless mode. The window-size is a way to control the responsiveness (and allows your site be displayed, like a mobile site, if you have not set a window size). Now we handle it with code,
  • We specify the path to our chrome driver
System.setProperty("", OpenBrowser.CHROME_DRIVER_PATH);
Properties prop = new Properties();
  • Now we have to do is to create a Web Driver object, and set the Chrome Driver path and some arguments
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless"); //for headless mode
options.addArguments("--window-size=800,600");//The invisible browser window is only 800x600 in size
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
driver = new ChromeDriver(options);

Now We Go to Azure DevOps For Pipeline

  • Go to Microsoft azure url – and sign in the microsoft account.
  • Click on start free. After you see yourself in Azure devops page.

Creating Azure Pipeline

  1. Login to your azure devops account ,create a organization and project.

2. Click “pipeline” option from left side menu

3. Click “Create Pipeline” button

4. Click the text “Use the classic editor” and create a connection with your source code tool whatever you are using and select the selenium project. Click “Continue”.

5. Select the “Maven” template and click “Add”.

6. Add the report (so that you can download the reports like html , emailable reports etc from pipeline)” in Publish build Artifacts” task to publish the report.

  • Path to publish – provide the path of your result folder which you want to publish.
  • Display Name – Provide task name.
  • Maven POM file – Give name of POM file (select the … dots and select the POM file)
  • Goal(s) – test
  • Publish to azure pipelines – Ensure checkbox is checked
  • Test run title – provide test run title name
  • Test results files – provide the path of test result file (i am using default)

7. Click “Save and queue” button, then click “Save and run”.

8. Click on Agent Job 1 ,to see the job logs

Reports and Artifact

  • After successful completion , click on ” Tests” tab to see the results in azure pipeline.
  • Click “Published” link to see the artifacts.
  • You can find the report here which you can download and use.

Summary of Report



Written by 

Prajjawal is a QA Consultant having experience of more than 1.6 year. He is familiar with core concepts of manual & automation testing using tools like Contract test, Selenium, and Postman Also having knowledge of Core Java, Python and Data Science. He is always eager to learn new and advanced concepts in order to improve himself. He likes to watch web series and play cricket.