Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Capturing value from data table
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Use this -

Code:
var = DataTable("UserID", dtGlobalSheet)
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
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)
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
to my knowledge for capturing value of the datatable there is only one method
Code:
var = DataTable("UserID", dtGlobalSheet")
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
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

------------------------------------------------------------------------------------------------------------
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  data table use uft_usr 1 2,276 06-29-2016, 05:23 PM
Last Post: Ankesh
  Writing to Run time data table Neetha 5 12,211 08-27-2015, 10:18 AM
Last Post: supputuri
  Capturing a value in a webtable EK21 4 4,431 08-21-2015, 01:08 AM
Last Post: EK21
  Need help in capturing the Calculator result using QTP 11 vishruth143 0 2,126 01-20-2015, 11:08 AM
Last Post: vishruth143
  How to mask the particular read only mode fields while capturing screenshot in QTP kalaivanan123 2 3,580 03-18-2014, 11:31 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)