[TechCorner Challenge #6] - Compare HTML table with Excel file and correct data in Excel file
Hi TestComplete Community!
Welcome to our weekly challenge where anyone can put their tool knowledge to the test! By completing the task, you will practice your TestComplete skills, learn new things about working with the product, and get into the TechCorner Leaderboard!
Check out this week’s task:
Since working with HTML tables and Excel files is quite common when working with TestComplete, here’s one more task connected to this topic.
Task: Create a script to compare an HTML table with an Excel file and correct the data in the Excel file.
So, when the script encounters an HTML table cell, the value of which is different from the value of the corresponding Excel table cell, the Excel cell value should be changed to what’s actually shown in the table.
- The HMTL table can be found here - Web Orders table.
- The Excel file is attached below.
Steps to follow to fulfill this task:
1. Parse the Orders table.
2. Save the table to the variable.
3. Working with Microsoft Excel Files - here you can choose the right way to extract data from the Excel file (TestComplete 14.50 users, check out the new Excel support - it does not require Excel to be installed on your machine).
4. Using a loop in the script, compare the table variable and Excel content cell-by-cell.
5. If the value in the Excel cell is different from the HTML table cell, it should be replaced with what’s shown in the table.
P.S. You can find the TechCorner Leaderboard and the rules of how to participate in the TechCorner Challenge by this link.