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 / rangalnrt
Hi,
May be you missed the syntax
you written---DataTable("LoginName",1)
DataTable.Value("LoginName",1)
Please check once whether it will solve your problem.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????
What are the types of object repository in qtp?
For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?
If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?
How to customize qtp?
I want to read XML file loaded in Quality center and compare the values with the values displayed in Application (web table).How can I do that
What is test object?
How to recognise the webelement and verifying that webelement is enabled?
How do you test DLL files using automation Tool QTP?
how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?
How to handle dynamic objects in quicktest professional (qtp)?
What are the different attribute used with regular expression?
How you can make an action as re-usable action?
When should I use smart identification?
what is the hierarchy to use properties in descriptive programming