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

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


Please Help Members By Posting Answers For Below Questions

What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????

2219


What are the types of object repository in qtp?

1071


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?

2370


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?

2077


How to customize qtp?

1088


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

1922


What is test object?

1198


How to recognise the webelement and verifying that webelement is enabled?

2243


How do you test DLL files using automation Tool QTP?

3283


how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

2470


How to handle dynamic objects in quicktest professional (qtp)?

995


What are the different attribute used with regular expression?

1020


How you can make an action as re-usable action?

1173


When should I use smart identification?

1198


what is the hierarchy to use properties in descriptive programming

2037