reference tasks

Task 6 : Extract tabular data from Web and update Excel

Reference Task

Task ID      TK 0000099 � v0.147
Release      //ReferenceTasks/Generic Tasks
Task Title      This task demonstrates extraction of tabular data from a webpage and updating the result in Excel sheet.

Description

This task demonstrates extraction of tabular data from a webpage and updating the result in Excel sheet.

Pre configured

For this example a web app “Clear_trip” for the site -cleartrip.com has been created in UI learn. A module - ‘New Module’ has been created under this app and From, To, Depart Date and Search flight controls are familiarized. CSV file containing required data for website automation.

Task DESIGN

Extract tabular data from Web and update Excel

Design steps

CSV Data � Upload the CSV file in the Template > CSV data section. From Properties of CSV Data node choose Read file from as �Repository� and select the required CSV file from drop down.

Mapping to Web UI node �
Select Origin, Destination and Depart_date from CSV and click on �Add� button to map.

Web UI node -
1. SET SCREEN command to set the screen to the module �NEW MODULE� created in UI learn 2. UIEVENT with the element origin and action Input. Provide the input from CSV by selecting the variable mapped. 3. UIEVENT with the element Destination and action Input. Provide the input from CSV by selecting the variable mapped. 4. A Default Expression - DELAY In Seconds is used � this is an optional step. 5. UIEVENT with the element Depart Date and action Input. Provide the input from CSV by selecting the variable mapped. 6. UIEVENT with the element Depart Date and action as Keyboard to provide enter action. Enable the keyboard by clicking on Keyboard icon and press �Enter key� from keyboard. 7. A Default Expression - DELAY In Seconds is used � this is an optional step. 8. UIEVENT with the element Airline and action as GetText. Store the value in a output variable �Airline�. 9. UIEVENT with the element Depart_Time and action as GetText. Store the value in a output variable �Depart_Time�. 10. UIEVENT with the element price and action as GetText. Provide the �Preferred airline� as input and store the value in a output variable �Price�.

Mapping to Excel �
Select Airline, Depart_Time, Price from Web UI node and click on �Add� button to map. Select Rec_num from CSV and click on �Add� button to map.

Excel node �
1. EXCEL COMMAND to open Excel and provide Excel file path 2. EXCEL COMMAND to select sheet by name and provide sheet_name as input. 3. Select Default expression from drop down and use Add expression. Provide num_1 and num_2 as input to calculate Rec_num and store the Value in output variable �Rec_num�. 4. Step 4, 5, 6 select Default expression from drop down and use Concat expression. Provide column name as input to string 1 and Rec_num as input to string 2. Store the Values in output variables �Cell1�, �Cell2�, �Cell3�. 7. Step 8, 9, 10 select EXCEL COMMAND to update cells. Provide input update_value � �Cell1�, �Cell2�, �Cell3� and update_cell � �Airline�, �Depart_time�, �Price� to update Airline, Depart_time, Price. 11. EXCEL COMMAND to save file. 12. EXCEL COMMAND to close file and provide the Excel file path. 13. EXCEL COMMAND to close excel.

Did you find what you were looking for?

Automation Analytics and AI in a box

Contact Us

HfS Hot Vendor

Option3's Automation capabilities featured in HfS Research's Hot Vendors List for Q3, 2018

Access your copy here