Micro Focus QTP (UFT) Forums
Conditional Statements from Data Table - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Conditional Statements from Data Table (/Thread-Conditional-Statements-from-Data-Table)



Conditional Statements from Data Table - golfer999999 - 03-05-2009

I have a number of actions saved that work fine, I am trying to make the call to those actions work off an if statement.

I can use the if statements when basing the statement on an object in the repository however this time I want to run the if statement on the value in the data table... but I can figure out how to do it.

Any help would be much appreciated - especially if you could tell me how using the Keyword view

Thanks
G9


RE: Conditional Statements from Data Table - sepgs2004 - 03-05-2009

Checkout the DataTable under the following help:
QuickTest Object model reference -> Utility Objects -> DataTable object.

I have used once like this to read from the global data table: DataTable("Name", dtGlobalSheet)
This will read the data under column: Name, of the row that corresponds to current iteration.
Also was able to access like this (my global data table has been just named 'Global"):
Code:
DataTable.GetSheet("Global").GetParameter("Type").value
If you look at the help, you will find some more info, so that you can access data at specific row, column.
Tips: When you read values...pay attention to the type of the data...After the value is read, may be you want to convert into String using CStr(...) so that you can compare easily...