Micro Focus QTP (UFT) Forums
Output Values on a Table Cell in a Loop - 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: Output Values on a Table Cell in a Loop (/Thread-Output-Values-on-a-Table-Cell-in-a-Loop)



Output Values on a Table Cell in a Loop - geet - 03-03-2010

Hi,
Code:
I am trying to capture run time values from a table using output values and storing them in the global data table, but it captures the value of first iteration of loop only and throws the error on further iterations. Please correct me on where i am doing wrong, my code is given below:
Dim i, n
'rowcount = DataTable.GetSheet("SearchJournal").GetRowCount

rowcount = 3
For i=1 to rowcount
DataTable.SetCurrentRow(i)
Browser("Acquisition Database").Page("Acquisition Database").WebEdit("ctl00$cphMain$txtJournalID").Set DataTable("JournalID", dtLocalSheet)
Browser("Acquisition Database").Page("Acquisition Database").WebButton("Search Acquisition").Click

Dim J_ID, Acq_ID
J_ID=DataTable("JournalID",dtLocalSheet)

Browser("Acquisition Database").Page("Acquisition Database").WebElement("1 Records Displayed").Check CheckPoint("1 Records Displayed")

Browser("Acquisition Database_2").Page("Acquisition Database").WebElement("Journal ID").Output CheckPoint("Journal ID")

Acq_ID = DataTable("Acquisition_ID", dtGlobalsheet)
Msgbox (Acq_ID)
'
Next
=====================================================
Error:


RE: Output Values on a Table Cell in a Loop - sreekanth chilam - 03-03-2010

HI Geet,

Just change the statement as given below in your code.
Code:
DataTable.GetSheet("SearchJournal").SetCurrentRow(i)



RE: Output Values on a Table Cell in a Loop - Saket - 03-03-2010

what is the error that you receive?


RE: Output Values on a Table Cell in a Loop - geet - 03-03-2010

"Can not identify the object "Journal Id" (of class Web Element). Verify that this object's properties match an object currently displayed in your application.
Line 16:
Code:
Browser("Acquisition Database_2").Page("Acquisition Database").WebElement("Journal ID").Output CheckPoint("Journal ID")