Automating Test Cases Using C# WinAppDriverScraping the UI Elements Using algoScraper Tool on Your Desktop

Scraping the UI Elements Using algoScraper Tool on Your Desktop

You can capture all UI elements and XPaths present on a desktop application page using the Desktop algoScraper tool.

Make sure you have installed the Desktop algoScraper tool. If not, refer to Installation steps for algoScraper.

How to Launch Desktop Scraper

Perform the following:

After installing the Desktop algoScraper tool, launch it by double-clicking the desktop application icon.

Alternatively, you can launch algoScraper while creating a new Desktop Automation project in algoQA.

Navigate to the Create Project page by clicking the + icon on the Projects page.

Enter the project name, select Desktop Automation as the automation type, and click the Launch button next to Do you want to launch AlgoScraper? to launch the Desktop Scraper.

Create Project dialog with Project Name, Automation Type, Launch button and file upload drop zone

A pop-up appears asking for permission to open the Desktop Scraper application.

Click Open to launch the Desktop Scraper.

This site is trying to open Desktop Scraper dialog with Open and Cancel buttons

To avoid this prompt in the future, select Always allow algoshack.net to open links of this type in the associated app before clicking Open.

Scraping Desktop Application

The Desktop Scraper screen appears. Click the Select Application button to choose the target application. Ensure that the application to be scraped is maximized. After clicking Select Application, click the target application within 3 seconds. The scraper window will reappear with the selected application. Enter the page name in the Screen Name field.

algoScraper desktop window with Selected Application Calculator and Screen Name field highlighted

The scraper provides the following options:

Scrape UI – Scrapes all UI elements on the selected screen at once.

Start Scraping – Scrapes UI elements one by one.

Record Scenario – Records a scenario based on the actions you perform on the application.

Scrape UI

Click the Scrape UI button to capture all UI elements.

The details of the scraped UI elements, along with their corresponding expressions, are displayed in the scraped list.

algoScraper window with Scrape UI button and scraped control list showing Control Name, Type and Action columns

The scraped list displays details such as the Control Name, Control Type, Action, Identification Type, Control ID, Screen Name, and Control Value for each scraped UI element.

You can edit the Control Name, Control Type, Action, Identification Type, Control ID, and Screen Name for each scraped UI element.

Currently, the supported identification types are XPath, Name, and ID.

To add a new step, click the + icon in the last column.

Ensure all the required details for the current step are completed before adding the next step.

You can delete a step by clicking the Delete icon in the corresponding row.

To scrape another page, enter a new page name in the Screen Name field and click Scrape UI.

The UI elements from the new page are scraped and appended below the previously scraped page in the scraped list.

algoScraper desktop window with scraped Calculator controls table and Reset, Download, algoQA buttons

You can search for a specific control by entering its name in the Search Control box.

All matching controls are displayed in the scraped list.

Click the Download button to download the scraped data as a JSON file.

You can then upload the JSON file to algoQA to generate test scenarios.

Click the algoQA icon to return to the Create Project page.

The scraped JSON file is automatically attached, allowing you to proceed with generating test scenarios.

Create Project dialog with Desktop Automation type and 'Use scraped data' checkbox highlighted

After downloading the scraped file, click Reset to restore the default settings, or click Close to exit the Desktop Scraper application.

If you want to scrape UI elements individually, enter the page name in the Screen Name field and click Start Scraping.

algoScraper window with Selected Application Calculator and Start Scraping button highlighted

A pop-up appears indicating that scraping has started.

Click the UI elements you want to scrape in the target application.

Alert dialog with message Started scraping, click on the elements to be scraped, and OK button

Navigate to the target desktop application and click each UI element to capture its corresponding expression.

As you click each UI element, it is highlighted in red to indicate that it has been selected for scraping.

Once you have finished scraping all the required UI elements, click Stop Scraping to end the scraping session.

algoScraper window with Stop Scraping button highlighted and table of scraped Calculator controls

The scraped list displays details such as the Control Name, Control Type, Action, Identification Type, Control ID, Screen Name, and Control Value for each scraped UI element.

You can edit the Control Name, Control Type, Action, Identification Type, Control ID, and Screen Name for each scraped UI element.

Currently, the supported identification types are XPath, Name, and ID.

To add a new step manually, click the + icon in the last column.

Ensure all the required details for the current step are completed before adding the next step.

You can delete a step by clicking the Delete icon in the corresponding row.

To scrape another page, enter a new page name in the Screen Name field and click Start Scraping.

Scrape the elements one by one and click Stop Scraping after scraping. The UI elements from the new page are scraped and appended below the previously scraped page in the scraped list.

You can search for a specific control by entering its name in the Search Control box.

All matching controls are displayed in the scraped list.

algoScraper window with Search Control box, Reset and Download buttons highlighted, and scraped Calculator controls table

Click the Download button to download the scraped data as a JSON file.

You can then upload the JSON file to algoQA to generate test scenarios.

Click the algoQA icon to return to the Create Project page.

The scraped JSON file is automatically attached, allowing you to proceed with generating test scenarios.

Create Project dialog with Desktop Automation type and 'Use scraped data' checkbox highlighted

After downloading the scraped file, click Reset to restore the default settings, or click Close to exit the Desktop Scraper application.

Record Scenario

The Record Scenario feature in the Desktop algoScraper allows you to capture and record your interactions with a desktop application in real time, generating a test scenario based on the actions you perform.

Enter the page name in the Screen Name field, then click Record Scenario to begin recording your interactions.

Enter the Scenario Name and Scenario Outline.

The Scenario Outline field is mandatory. After entering the required details, click Start Recording to begin recording the scenario.

algoScraper window with Start Recording button and Scenario Name, Scenario Outline fields highlighted

The Desktop Scraper is minimized automatically.

Perform the actions you want to record in the target application. Once you have completed the recording, return to the Desktop Scraper and click Stop Recording.

Desktop Scraper minimized toolbar with Stop Recording button

The recorded list displays details such as the Control Name, Control Type, Action, Identification Type, Control ID, Screen Name, and Control Value for each recorded step.

algoScraper recorded control list table with Control Name, Type, Action, Identification Type and Control Id columns

You can edit the Control Name, Control Type, Action, Identification Type, Control ID, and Screen Name for each scraped UI element.

Currently, the supported identification types are XPath, Name, and ID.

You can delete a step by clicking the Delete icon in the corresponding row.

You can search for a specific control by entering its name in the Search Control box.

All matching controls are displayed in the scraped list.

You can record another scenario by clicking Add Scenario.

algoScraper window with Add Scenario button highlighted above recorded Calculator scenario steps table

The scenario will be saved. Click Start Recording to record the next scenario.

Click the Download button to download the scraped data as a JSON file.

You can then upload the JSON file to algoQA to generate test scenarios.

Click the algoQA icon to return to the Create Project page.

The scraped JSON file is automatically attached, allowing you to proceed with generating test scenarios.

Create Project dialog with Desktop Automation type and 'Use scraped data' checkbox highlighted

After downloading the scraped file, click Reset to restore the default settings, or click Close to exit the Desktop Scraper application.