Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP datasheet Help
#1
Solved: 11 Years, 4 Months ago
Hi Ankur,

I would like to know how to get specific text from a web base application and insert it in a specific cell location of a local datasheet to be reused in other scripts.
Example: the application I'm working with will generate a user ID, this User ID is displayed in a comment field on a web page. I would like to capture the generated User ID and have it inserted in a specific cell of the local datasheet. The local datasheet is imported everytime the test runs so the cell's value will always change from test to test. Also I will need to know how to retrieve that ID from that specific cell to reuse in future test.

Thank You.
Reply
#2
Solved: 11 Years, 4 Months ago
what you can do is
add a parameter(UserID) in the datatable after importing the sheet,
retrieve the userid from your page using GetROProperty like if the field is webelement then use it like
.GetROProperty("innertext")
insert the userid captured into the parameter added in the datatable using Datatable("UserID",dtlocalsheet) = Value
same way you can retieve from datatable

hope this helps you to start with, try and let us know if you have any issues.

Reply
#3
Solved: 11 Years, 4 Months ago
Thank You Saket this was helpful, just wanted to give you a little more info. The data I'm trying to retreive is in a webelement field and I have a UserID parameter in my datatable. The ID i'm trying to retrieve is not the only data in that field here is an example of what would be in that field and how do I just capture the ADID and insert it in the UserID parameter of the datable.........
test request for fixes; test; ADID=XXX4XXX . Default Password=XXX-XXXXXXX

The ADID will always change from test to test but it will always be displayed after ADID=

Thanks,
Brian
Reply
#4
Solved: 11 Years, 4 Months ago
Parsing the string should help -
Code:
Str = "test request for fixes; test; ADID=XXX4XXX . Default Password=XXX-XXXXXXX"
nStart = instr(str,"ADID=")+5
nUpto =  Instr(nStart,str," ")- nStart
Userid = mid(str, nStart,nUpto)
msgbox Userid

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Storing runtime value into datasheet priyaUFTlearner 4 3,426 04-10-2015, 10:08 PM
Last Post: priyaUFTlearner
  Error with QTP DataSheet Values. srach84 1 2,129 11-27-2014, 10:32 AM
Last Post: vinod123
  Way to take values from datasheet and output Fairbanks 3 3,122 03-27-2014, 07:18 PM
Last Post: Ankur
  Import and read multiple tabs on a datasheet trance07 1 3,378 10-09-2013, 07:29 PM
Last Post: Parke
  Sometimes there is Global datasheet. utestqa 0 2,712 10-02-2013, 07:09 PM
Last Post: utestqa

Forum Jump:


Users browsing this thread: 1 Guest(s)