UI automation testing simplifies the automation of user interactions and validations within applications. ComponentOne controls integrate with testing tools to enable you to create highly effective UI testing environments. This integration allows developers to automate UI tests that can simulate user interactions with ComponentOne controls.
This document enables automation testers and developers to enhance and test applications using Appium.
Prerequisites require a basic understanding of Windows application testing, Appium, Windows Application Driver (WinAppDriver) and programming in C# .NET.
Software Requirements
- Windows 10 or higher.
- Microsoft Visual Studio - Community Edition or higher with below features:
- .NET Desktop developement
- Nuget Package manager
- Testing tools
- Windows Application Driver
- Node.JS
- Appium
Automation Testing with Appium
Automation testing is helpful for testing and facilitates the agile software development lifecycle. Appium is an automation testing tool for UI Automation tests and Software Functional Testing for desktop applications. Appium also supports mobile automation. To use Appium with WinAppDriver, follow the below steps:
- Enable Developer Mode through Windows Settings | Update & Security | For Developers.
- Install Node.JS. You can download it from the link below:
https://nodejs.org/en/download
- To install Appium follow the below steps:
- To open Command Prompt, press Win + R | Type cmd and press Enter.
- In the Command Prompt, enter the command: NPM install -g appium and press Enter. This step installs the Appium on your computer.
- Install the WinAppDriver by following the below steps:
- Go to the WinAppDriver github page, the URL is given below:
https://github.com/Microsoft/WinAppDriver
- Click the Releases link, choose latest stable versions.
- Expand the Assets arrow.
- Click WindowsApplicationDriver.msi to download it. Once downloaded, install the WindowsApplicationDriver. Run WinAppDriver.
From the File Explorer find the Windows Application Driver folder in Program Files(x86) if 64-bit OS or Program Files otherwise. Run the WinAppDriver.exe file. The WinAppDriver uses http protocol on port number 4723 by default. Note, the WinAppDrive application will fail to start if this port number is not reachable.
Note: Run the WinAppDriver.exe first before running WinAppDriver based UI automation, else test scripts will fail. The WinAppDriver is a console application and does not contain an UI.
Running Tests on Application
For running an Automation test application on any test app, you need to script the test cases that run test on your application. Follow the below steps to run test on your application using Appium:
- Right-click the solution in Solution Explorer. | Add a new project. | Choose Unit Test Project.
- Add the script for testing using Appium.
- Run WinAppDriver application from the installed location.
- Build your application.
- Add the absolute path of the .exe file of your application from the windows explorer as parameter to WindowsDriver class in the test script.
- Complete the test script as per your requirement.
- Right-click on the Unit Test Project from the Solution Explorer | Choose Run Tests.
Observe Appium running the test and reporting test results.