studio
2020.10
false
UiPath logo, featuring letters U and I in white
OUT OF SUPPORT

Studio User Guide

Last updated Dec 20, 2023

Example of Using Text Automation

To exemplify the automation of a process by using text recognition activities, we created an automation project that opens Internet Explorer and navigates to a Wikipedia article with tables of historical exchange rates to the United States dollar. It extracts data from the table for recent years, displays it in the Output panel, and checks if the currency Euro is found in the table.

Note: It is recommended to run your web automations on Internet Explorer 11 and above, Mozilla Firefox 50 or above, or the latest version of Google Chrome.
  1. Open Internet Explorer and navigate to https://en.wikipedia.org/wiki/Tables_of_historical_exchange_rates_to_the_United_States_dollar#Table_for_recent_years.
  2. In Studio, create a New Blank Process.
  3. From the Activities panel, add an Open Browser activity to the Designer panel and, in the Url field, type: "https://en.wikipedia.org/wiki/Tables_of_historical_exchange_rates_to_the_United_States_dollar#Table_for_recent_years".


  4. In the Design ribbon tab, in the Wizards group, click Data Scraping. The Extract Wizard is displayed.
  5. Click Next, select a cell from the Table for recent years on the web page, and then click Yes when prompted to extract the data from the whole table. A preview of the data is displayed in the Preview Data wizard step.
  6. In the Maximum number of results field, type 200, and then click Finish. We need to do this because our table contains a large number of entries and we want to make sure the entire table is extracted.
  7. In the Indicate Next Link window, click No because our data does not span multiple pages. The process is updated and a Data Scraping sequence is displayed in the Designer panel. In this sequence, an Attach Browser activity is generated, containing an Extract Data activity that retrieves the table contents. The data is stored in the automatically generated DataTable variable ExtractDataTable.


  8. Create a new String variable called GetText with the scope set to Sequence.
  9. Add an Output Data Table activity in the Do container of the Attach Browser activity, after the Extract Data activity. This activity converts the table data to a string that can be displayed in the Output panel.
  10. Select the Output Data Table activity, add the ExtractDataTable variable in the DataTable field, and the GetText variable in the Text field.
  11. Add a Write Line activity after the Output Data Table one, and add the GetText variable in the Text field. In this way, the data extracted from the table is written in the Output panel.


  12. Add a Delay activity after the Data Scraping sequence and set the Duration property to 00:00:03 (3 seconds). This delay has the purpose of allowing the web page to become fully loaded before the next activity is performed.


  13. In the Variables panel, create a new variable, called GetExists, and set the type to Boolean and the scope to Sequence.
  14. Add a Text Exists activity after the Delay activity and type "Euro" in the Text field. Click the Indicate on screen button and then click the table cell with Euro in the previously opened browser page. A selector is generated for the UI element. In this case, the activity checks if the word Euro is found in the table.


  15. Select the Text Exists activity and then, from the Properties panel, insert the GetExists variable in the Exists field.
  16. Add an If activity after the Text Exists activity and insert the GetExists variable in the Condition field.
  17. Add two Message Box activities, one in the Then section, the other in the Else section of the If activity.
    • Select the Message Box activity in the Then section and type "Euro appears in the table." in the Text field. This message is displayed if the word Euro is found in the table.
    • Select the Message Box activity in the Else section and type "Euro does not appear in the table." in the Text field. This message is displayed if the word Euro is not found in the table.

      Your workflow should look like this:



  18. Press F5 to execute the project. Note that the data from the recent exchange rates table is extracted and displayed in the Output panel, and a message box is displayed, stating whether or not the word Euro was found.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.