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
What is the virtual object?
What is the keyword view and expert view in qtp?
When Recovery scenario actually starts while testing the application?
How many types of object repository in qtp?
What is the difference between per-action and shared?
What are the Disadvantages of shared object repository?
what you mean by artifact,milestone...
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 is error and fault in terms of software quality?
i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.
What is CMMP and CMMH?
i can done the project with QTP in that time i can say how many members in my team size?
How would you export a script from one pc to another in qtp?
How can you send user defined messages to test report?
How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.