Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What are the limitations in using Virtual objects?

1 Answers   ITC Infotech,


hi friends i was tried to connect qtp with oracle database using provider.i got a error.so anyone can help me out by correct script

2 Answers  


How to test login page by using QTP

6 Answers  


For which type of projects the iterative model is not suitable?

0 Answers  


Give answer with example what is orthogonal array testing technique?

1 Answers   CTS, Wipro,


How to customize checkpoints with parameters?

0 Answers  


In qtp, how you can exit for loop?

0 Answers  


What is the difference between analog and low level recording?

0 Answers  


What is meant by a Check Point in UFT? Also, explain the applicable Check Points.

0 Answers  


what is the advantages and disadvantages of using functions instead of re usable actions

0 Answers  


Hi Samrat, Thank u very much, what u said it is right.

0 Answers  


How can we translate the steps between the Keyword and Expert Views?

1 Answers  


Categories