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

Capture all UI elements from a desktop application using the algoScraper desktop tool — scrape elements in bulk or one by one, record scenarios, and export the results as a JSON file for test generation.

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 to launch the Desktop Scraper.

Launch the Desktop Scraper

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.

Create a Desktop Automation project

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, select the language, select the framework, and click Create Project.

Create Project page for Desktop Automation with configuration fields
Create Project page for Desktop Automation with configuration fields

Choose a scenario creation method

The scenario creation screen appears with three options. Select Record Scenario to record a scenario.

Scenario creation screen with three options including Record Scenario
Scenario creation screen with three options including Record Scenario

Allow the Desktop Scraper to open

A pop-up appears asking for permission to open the Desktop Scraper application. Click Open to launch it.

This site is trying to open Desktop Scraper dialog with Open and Cancel buttons
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 provides two main options:

  • Scrape UI: Scrapes all UI elements on the selected screen at once, or scrapes UI elements one by one.
  • Record Scenario: Records a scenario based on the actions you perform on the application.
Desktop Scraper main screen with Scrape UI and Record Scenario options
Desktop Scraper main screen with Scrape UI and Record Scenario options

Scrape UI

Use the Scrape UI option to capture UI elements from your desktop application. You can scrape all elements at once or scrape them one by one.

Scrape all UI elements at once

Select the target application

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. The Screen Name field is filled automatically.

algoScraper window after selecting the target application with Screen Name field populated
algoScraper window after selecting the target application with Screen Name field populated

Click 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 displayed
algoScraper window with Scrape UI button and scraped control list displayed

Review the scraped elements

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

Edit element details

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.

Add a new step

To add a new step, click the + Row button. Ensure all the required details for the current step are completed before adding the next step.

Delete a step

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

Scrape another page

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.

Search for a control

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.

Download the scraped data

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.

Return to algoQA

Click the algoQA icon to return to the Test Design screen. The scenarios will be generated automatically. Review the scenarios and click Generate to generate test cases. To learn more, refer to Generate Test Cases and Test Scripts.

Scrape UI elements one by one

Select the target application

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. The page name is automatically entered in the Screen Name field.

Start scraping the elements

If you want to scrape UI elements individually, click the UI elements you want to scrape in the selected application.

algoScraper window with Start Scraping button highlighted for individual element scraping
algoScraper window with Start Scraping button highlighted for individual element scraping

Click UI elements to capture them

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.

Review the scraped elements

algoScraper window showing the scraped elements list from individual scraping
algoScraper window showing the scraped elements list from individual scraping

Edit element details

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.

Add a new step

To add a new step manually, click the + Row button. Ensure all the required details for the current step are completed before adding the next step.

Delete a step

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

Scrape another page

To scrape another page, enter a new page name in the Screen Name field and continue scraping. Scrape the elements one by one. The UI elements from the new page are scraped and appended below the previously scraped page in the scraped list.

algoScraper window showing scraped elements from a new page appended to the list
algoScraper window showing scraped elements from a new page appended to the list

Search for a control

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 highlighted and filtered results in the scraped list
algoScraper window with Search Control box highlighted and filtered results in the scraped list

Download the scraped data

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.

Return to algoQA

Click the algoQA icon to return to the Test Design screen with the scenario. Review the scenario and click Generate to generate test cases.

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

Reset or close the scraper

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

Record Scenario

Use the Record Scenario option to capture your interactions with a desktop application in real time and generate a test scenario based on the actions you perform.

Select the target application

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. The page name is automatically entered in the Screen Name field.

algoScraper window after selecting the target application for recording a scenario
algoScraper window after selecting the target application for recording a scenario

Configure the scenario

Enter the Scenario Name and Scenario Outline, then click Start Recording. You can also hide the scraper by clicking the toggle button next to Start Recording.

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

Perform actions in the target application

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.

algoScraper window with Stop Recording button highlighted during active recording
algoScraper window with Stop Recording button highlighted during active recording

Review the recorded steps

After you click Stop Recording, you will be directed to the Scenario List. Click the scenario to view the recorded steps. The list displays details such as the Control Name, Control Type, Action, Identification Type, Control ID, Screen Name, and Control Value for each recorded step. From here, you can:

  • Click the + icon to record a new scenario.
  • Click the Download icon to download the scraped data in .json format.
  • Click the algoQA icon to return to the Test Design page with the generated scenario. Review the scenario and click Generate to generate test cases.
algoScraper Scenario List showing recorded scenario steps with action, download, and algoQA buttons
algoScraper Scenario List showing recorded scenario steps with action, download, and algoQA buttons

Edit element details

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

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

Delete a step

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

Search for a control

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 highlighted and filtered results in the recorded scenario list
algoScraper window with Search Control box highlighted and filtered results in the recorded scenario list