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 / 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 |
Post New Answer View All Answers
How is UFT 11.5 version different from UFT 12.0?
Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.
How do you perform Regreession Testing?
How to attach a file to TD?
how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?
Did QTP prove efficient for your project? Yes or No, explain?
how to post xml data from QTP scripts to any application?
How to build scripts that access data from external sources?
What is object spy in quicktest professional (qtp)?
Explain how you can find the absolute value of the number in qtp?
How to write business scripts using object repository with different scenarios
What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?
How can i check items sorted or not in a weblist ? Give me the script for this...
How you will rate urself in QTP in the range of 0 to 5
Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this