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



Hi, I have a login page. To login in that page I need to have a valid username and password, wh..

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

Hi, I have a login page. To login in that page I need to have a valid username and password, wh..

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

Hi, I have a login page. To login in that page I need to have a valid username and password, wh..

Answer / 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

More QTP Interview Questions

Please explain how to open with notepad of saved html file by right click option using QTP

1 Answers  


.how will you load the object during runtime

2 Answers   TCS,


what is error and fault in terms of software quality?

0 Answers   TCS,


How we can add actions in the test using QTP?

4 Answers   BirlaSoft,


What are the technologies supported by qtp?

0 Answers  






how can we know the program is testing by multiple test data in data driven frame work?

1 Answers   CTS,


In the website, the protocol has been changed http: to https what you will do? Tell me your approach?

0 Answers  


what is Compile Module in QTP? what exactly it contains Functions or Actions?

1 Answers  


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?

0 Answers   V2 Solutions,


What r steps to migrate from Manual testing to QTP?(IN BOTH WEB BASED AND WINDOWS APP)

1 Answers   Wipro,


str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any one knows send to answer

3 Answers   Ziynx,


normally by going through the object properties in object spy we write descriptive programming(correct me if i am wrong). But how or from where can we get the object properties in the object spy?plzzzzzz do answer

2 Answers  


Categories