Micro Focus QTP (UFT) Forums
Capturing value 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: Capturing value from data table (/Thread-Capturing-value-from-data-table)



Capturing value from data table - kriday - 06-26-2013

Code:
Browser("SomeName").Page("SomeName").WebEdit("QuickSearchTerm").Set DataTable("UserID", dtGlobalSheet)

I want to capture the UserID value from data table in to a variable , So, I have written this

Code:
Dim var
var=Browser("SomeName").Page("SomeName").WebEdit("QuickSearchTerm").Set DataTable("UserID", dtGlobalSheet)

But I am getting syntax error that this line needs end of statement

Is there any way to capture the above data table value in to a variable

Thanks in advance


RE: Capturing value from data table - Ankur - 06-27-2013

Use this -

Code:
var = DataTable("UserID", dtGlobalSheet)



RE: Capturing value from data table - kriday - 06-27-2013

Thans for repying.
Code:
var = DataTable("UserID", dtGlobalSheet)

This I have tried and is woring but not woring for
Code:
var=Browser("SomeName").Page("SomeName").WebEdit("QuickSearchTerm").Set DataTable("UserID", dtGlobalSheet)



RE: Capturing value from data table - vinod123 - 06-27-2013

to my knowledge for capturing value of the datatable there is only one method
Code:
var = DataTable("UserID", dtGlobalSheet")



RE: Capturing value from data table - basanth27 - 06-27-2013

You cannot retrieve a value when you have used SET method. You can only do it on a GET method.
Code:
Browser("SomeName").Page("SomeName").WebEdit("QuickSearchTerm").Set DataTable("UserID", dtGlobalSheet)
var = Browser("SomeName").Page("SomeName").WebEdit("QuickSearchTerm").getroproperty("innertext")
msgbox var



RE: Capturing value from data table - ramkamal - 10-31-2013

Chech below/attached notepad. Check below steps and let me know if you have any questions.

Step 1: Call or open data file
Step 2: Update Entry number on the notepad with new value ( 90001236) - 6 digits.
Step 3: Save notepad after update Entry Number.
Step 4: Save new Entry number on Global data table for my later use
(I will use this Number after I submit this updated notepad to the Q. Also I will use this number for search by Entry number for another UI system)
-------------------------------------------------------------------------------------------------------------
A1901SSH 05091201
B011901SSHSE
SE10ASSH 90001236 01EI 23-0032980004181234567890 1
SE15M 00552313900
SE15H APWB001
SE30SE SELLING COMPANY
SE3515 420 John Street
SE36TAIPEI TW
SE30BY BUYING COMPANY
SE3515 144 Buyer Street
SE36CITYVILLE CA 90210 US
SE30ST SHIP TO COMPANY
SE3515 720 Shipper Road
SE36CITYVILLE CA 90210 US
SE30LG STUFFING COMPANY
SE3515 116 STUF Marg
SE36KWAI CHUNG HK
SE30CS CONSOLIDATING COMPANY
SE3515 123 MAIN ROAD
SE36HONG KONG HK
SE40001CN BRAND NAME WATCH MODEL ABC
SE50CN EI 23-003298000
SE50MF MANUFACTURING COMPANY
SE5515 123 MAIN ROAD
SE56TAIPEI TW
SE600101110010
SE600101110010
Y 0000SSHSE00001
Z0000SSH 11011101

------------------------------------------------------------------------------------------------------------