Verifying values is key to avoid errors in the program flow and to make appropriate decisions in your scripts. This sample code shows how to print the contents of all table cells by using a BDLT project and is intended to demonstrate how to perform a full table scan and enable data verification. The first thing to observe is the use of indexes in the locator strings. Here we use the indexes, represented by brackets and a number (or a variable inside the brackets) to refer to specific rows and columns that share the same basic xpath locator. The key to adapt this script to your particular needs is to finding out how your locators are organized. Try validating the locators as shown in the picture below, varying the /TR and /TD indexes in the brackets. These are our rows and column pointers used in the script. In the example, we’ll be printing the values from row 2 and column 2, as indicated below: Here’s how the main part of the code with comments looks like: The Print() statement will output the contents of every cell to the Output Window, as displayed below: PrintTableBDLT.zip
↧