Now let's open up the Flight application. Let's say that we want to capture some values at runtime and write them to our global spreadsheet that gets exported. For this exercise we will add some code that will capture the price of the order.
First, we need to add a header to our spreadsheet but we won't be putting in any values, our script will do that.
Then we will use the object spy to point to the element we want to capture the value during runtime. In this case, I selected the first box that is titled "price."
First we find the Properties/Values pair that has the information we want. It looks like we want the "text" property because it has the value "$369.60" Then we switch from the properties tab to the operations tab to find the method we will be using.
The Properties/Values pair:
For the method, we are going to choose the GetROProperty because RO means RunTime. So this is saying get the value of the property you pass this method (we are going to be passing "text") at the run time of the script.
Also note the Nested hierarchy of windows that the object spy shows us:
Referring to the nested hierarchy at the top of object spy's results, we will add this line:
This line of code is writing the captured value of price (as the script is running) to our column on the global datatable called "PRICE." This then gets exported at the end with our global datatable.
After we re-play our script, the exported spreadsheet looks like this: