Hi,
I have a login page. To login in that page I need to have a
valid username and password, which is stored in database. I
imported that table to my DataTable in QTP (Global sheet).
Now I need to write a code in qtp so that I can login only
with valid username and data.
my condition is : I want to get username and password from
inputbox(which i did) and click on login button- which should
verify the datatable for username and password and if value
is present only then lofin else stop the testing.
DataTable contains columns : LoginName and Password
Code:
Rowcount= DataTable.GetSheet("Global").GetRowCount
msgbox "RowCount= " &RowCount,1
CurrentRow= DataTable.SetCurrentRow(1)
Do
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$UserName$ctl").Set DataTable("LoginName",1)
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$Password$ctl").Set DataTable("Password",1)
Browser("").Page("").Frame("Frame").Link("Login").Cli
ck
CurrentRow=CurrentRow+1
Loop Until CurrentRow>Rowcount
Can anyone help?
Thanks,
Priya
Answer Posted / sandip mehra
First of all you have to add a sheet at the runtime data
table and then have to import the data from the excel sheet
so for that you have to use import sheet method, then after
follow all your process means you can use your script which
you have written over here.
follow the process and then let me know if you'll get any
error.
Regards
Sandeep Mehra
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji
I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?
What are the different recording modes and how do they work?
What is Associate Repository in QTP 9.2 ?
How to data driven test for Win objects in QTP ?
What is the difference between a Function and Action in QTP?
I have qtp 9.5 demo ver,I am not able to record the yahoo broeser.so anyone can tell me what setting i have to do in QTP for yahoo brower recording. why its not recognise the object of yahoo browser????
explain abt dyanamic changing object with example?
Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link
Why bpt?
In the application that I'm testing is having a WYSIWIYG editor.QTP is recording editor's body as web element. I want to add some data to this web Element at run time. The problem is that I cant find a method to add contents to this web Element. Can any one come up with an answer for this. Thankx.
For which type of projects the iterative model is not suitable?
What are the general steps involved in the data driven framework?
Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.
Explain runtime dynamic settings?