0brine
0brine

Reputation: 486

WinAppDriver in Azure devops pipeline to test applications

In the company I am working I was given the Task to design a system to automatically test Windows Applications.

My approach:

The Problem:

My thoughts:

Any suggestions how to improve the system / make it work without anyone having to connect to the VM manually?

Upvotes: 1

Views: 1446

Answers (2)

I believe you can use WinAppDriver CI task on your pipeline https://github.com/Microsoft/WinAppDriver/wiki/WinAppDriver-in-CI-with-Azure-Pipelines

In YML it should look like this:

  - task: Windows Application Driver@0
    inputs:
      OperationType: 'Start'

  #Run your tests here

  - task: Windows Application Driver@0
    inputs:
      OperationType: 'Stop'

In the page linked above there is a link on how to make your custom agent meet the requirements. If the hosted agents do not meet your requirement, try using a private agent. More information on this below.

Upvotes: 1

Kamil Chodoła
Kamil Chodoła

Reputation: 21

Let me describe how we run our tests:

  • 1st stage - run VM using webhook to Azure Portal
  • 2nd stage - checkout code, start WinAppDriver console, build code, run tests, stop WinAppDriver, cleanup of env
  • 3rd stage - stop VM using webhook to Azure Portal

1 and 3 are ensuring we spent only minimum amount of $$$ for best possible VMs to run tests as quickly as possible 2 is establishing environment, testing and cleaning up

By this approach we are sure that every single time everything is fresh (version of application for test and version of tests) + every component is opened again. There is no dependencies to old runs (since VM was restarted) and I can say it is working really stable and entire configuration did not take more than 5 minutes.

This may also work for You since VM will be running only for a time of Test Execution and then will be closed. This approach needs to have Azure DevOps agent installed on VM which will be running as a console (not as a service) + autologon must be on place. Without above it will be impossible to achieve proper Pipeline without human interaction.

Upvotes: 2

Related Questions