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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ranga
Hi,
import the data to data table and
Please check the syntax once
you written as ------DataTable("LoginName",1)
DataTable.Value("LoginName",1)
may be above is the problem getting the username n password.
Is This Answer Correct ? | 0 Yes | 0 No |
How can I change object description or check point values in qtp?
How to call .vbs functions in QTP? plz Explain indetail
Hello, I am facing problem to check textpoint for mercury application . I have inserted checkpoint to check flight summary for place of departure and arrival with datatable and script look like "Browser("Find a Flight: Mercury").Page("Book a Flight: Mercury").Check CheckPoint("Book a Flight: Mercury_4")" but while I am executing this script at last my check point gets fail and display Text Checkpoint: captured "" between Summary and 4/31/2008FLIGHT , expected "Acapulco" Match case: ON Exact match: OFF Ignore spaces: ON I think value from data table is not fatched so please guide me what I have to do to overcome this problem.. Thanks
What is the use of Accessibility check point?
Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Advance
What is object repository?
Explain about Table and DB Checkpoints?
can we do load testing , by using QTP......?
.qfl extension for which file? where vl use it
where we are going to write the descriptive programming.for example we are invoking qtp application where we are going to write that code
how do check the links in a webpage ?
What is the disadvantage of smart identification?