Micro Focus QTP (UFT) Forums

Full Version: DataTable Local Sheet Identification Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I wrote VBScript to insert values to DataTable before the Execution of the QTP Script.
VBScript :
Code:
Dim Low
Dim High
Low=100000
High=150000
For i=0 to 4
datatable.setcurrentrow(i)
datatable.value("PriceLow",4)=Low
datatable.value("PriceHigh",4)=High
Low=Low+50000
High=High+50000
i=i+1
Next
In QTP Script "HSearch"I am calling a reusable Action "Action1" from another Test "ReuseEvent".
"HSearch" Action Structure:
(ActionName)Login
-->(Called ActionName)ReuseEvent
(ActionName)Search

DataTable has following Sheets:
Global,Login,ReuseEvent,Search

I am using the above VBScript to insert values in Search Sheet.
When the script is executed the values are inserted into Search Sheet. But when the QTP Script is executed it gives error message:
"Cannot identify the specified item of the PriceLow object. Confirm that the specified item is included in the object's item collection. "
Code:
"Browser("Chicago Top Condos - Real").Page("Chicago Top Condos - Real").WebList("PriceLow").Select DataTable("PriceLow", dtLocalSheet)".

I have tried changeing the above code as
Code:
"Browser("Chicago Top Condos - Real").Page("Chicago Top Condos - Real").WebList("PriceLow").Select DataTable("PriceLow", 4)".

"Browser("Chicago Top Condos - Real").Page("Chicago Top Condos - Real").WebList("PriceLow").Select DataTable("PriceLow", Search)".


But I am not successful in executing the script as it keeps popping message that it cannot identify the Object.

Please help me in how to get this script execute successfully.[/b]
From your well documented post it looks as though the problem is in recognizing the PriceLow object not in pulling a value from the datatable.
In my qtp,
when i value is zero, it uses first row of datatable when i value is zero and one
so you are resetting first row in 4th sheet as 100000+50000

solution: loop with i=1 (instead of 0)