Automating Test Cases Using C# WinAppDriver
Automate desktop application test cases with C# WinAppDriver and algoQA — scrape UI elements, record scenarios, generate test scripts, and execute them for Windows applications.
Automate desktop application test cases by integrating algoQA with the C# WinAppDriver framework. This guide walks you through scraping UI elements, recording scenarios, generating test cases and scripts, and executing them.
Prerequisites
- To configure C# WinAppDriver and other required components, refer to the Installing C# WinAppDriver article.
- To install the algoScraper tool, refer to the Installation steps for algoScraper article.
Use Case
This use case demonstrates the automation of a Calculator application by integrating algoQA with the C# WinApp framework using the C# language. The example showcases an in-sprint automation process, automating the steps of adding two numbers and verifying the sum.
Design the Tests
Test Designing is creating an offline model of an application under test (AUT), which involves mimicking a UI model of an AUT using nodes, features and UI elements.
Using algoQA, you can perform the following:
Scraping the UI Elements
-
You can scrape the required UI elements using the algoScraper tool. Refer to the Scraping the UI Elements using algoScraper Tool article for more details.
-
Scrape all the required UI elements and download the file which is available in .json format. The downloaded spreadsheet contains control name, control, XPath and Page Name.
-
Make sure all the page names are the same as the UI element's names.
Alternatively, you can upload the scraped file and view the automatic node placement, associated features and UI elements on the Canvas.
Record Scenarios Using the Offline Recorder
The offline recorder feature is used to record and save the workflow, scenario, or use case. The scenario will be saved in the same sequence it has been recorded.
Recording for the Record Scenario feature is done in an offline model. It doesn't interact with the live application.
For more information, see Record a Scenario Using Offline Recorder.
Editing Scenarios
This section guides you through the process of scenario editing and adding features along with their associated UI elements or controls to existing features.
For more information on how to edit scenarios, refer to Managing Test Cases using Edit Scenarios Workflow.

Generate Test Cases and Test Scripts
After generating the scenario, the next step is generating test cases and test scripts.
For more information, see Generate Test Cases and Test Scripts.
Executing Test Scripts
To execute the generated scripts, see Executing Test Scripts for C# WinAppDriver.