Geeks Talk

Prepare for your Next Interview




How to Script Username and Password Using QTP

This is a discussion on How to Script Username and Password Using QTP within the QTP forums, part of the Software Testing category; I really need to know how to Automate the Username and Password for 3 different web-based Surveys using QTP. Each Survey opens up a little differently but at the ...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-16-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
How to Script Username and Password Using QTP

I really need to know how to Automate the Username and Password for 3 different web-based Surveys using QTP. Each Survey opens up a little differently but at the exact same point they all ask for the same username and password, so I need to know what's the best way to create a script so that the username and password is automated across the board for all 3 surverys since the username and password is the same for each.

Thanks so much
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 164
Thanks: 3
Thanked 11 Times in 11 Posts
NawabShaikh is on a distinguished road
Re: How to Script Username and Password Using QTP

1. Browser(B).Page(P).WebEdit(Password).SetSecure ""

password can be encrypted using datatable.

2. In case there are multiple application's authnticated using same User Id & Password then u can parameterize the same script & fetch UserID & Password from a text file..



Regards,
Nawab
Reply With Quote
  #3 (permalink)  
Old 07-17-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
Re: How to Script Username and Password Using QTP

OK Thanks so do I create a Script and then record the Username and Password and make that a Reuseable Action? How can I parameterize this and call it from Scripts that are already created? Is there a way to make this a reuseable action and call it in Scripts that are run in a batch without having to modify every script I already created?
Reply With Quote
  #4 (permalink)  
Old 07-17-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 164
Thanks: 3
Thanked 11 Times in 11 Posts
NawabShaikh is on a distinguished road
Thumbs up Re: How to Script Username and Password Using QTP

If there are scripts present's for the different flows ..u just need to have a common data source for the userID & Password..

Solution ONE
Master Action Call all the 3 actions with parameter's(User ID & Password)
Reusable Action1........put the data in Input Parameter's
Reusable Action2........put the data in Input Parameter's
Reusable Action3........put the data in Input Parameter's


I am bit skeptical about ur implementation...could u please give details on how are u managing ur test..that can help us to give u a lucid answer.


Regards,
Nawab
Reply With Quote
  #5 (permalink)  
Old 07-21-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
Re: How to Script Username and Password Using QTP

OK so I can about 25 existing scripts and we commented out the Username and password portion because at first QTP was recongzing it, but now I need to record the Username and Password and make it a Reuseable action for all the existing scripts. Each script is going to use the exact same userid and password so I simply need to know #1 How to create that action in QTP 9.5 and then how to recall that action for all the existing scripts that will use that exact same user id and password. How do you tell 25 existing scripts to call One action if they are run in a batch?
Reply With Quote
  #6 (permalink)  
Old 07-21-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
Re: How to Script Username and Password Using QTP

How do I create parameters for the User ID & Password? I am very new to QTP so I appreciate all your help in this matter.
Reply With Quote
  #7 (permalink)  
Old 07-21-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 164
Thanks: 3
Thanked 11 Times in 11 Posts
NawabShaikh is on a distinguished road
Arrow Re: How to Script Username and Password Using QTP

Quote:
Originally Posted by sbbceo View Post
OK so I can about 25 existing scripts and we commented out the Username and password portion because at first QTP was recongzing it, but now I need to record the Username and Password and make it a Reuseable action for all the existing scripts. Each script is going to use the exact same userid and password so I simply need to know #1 How to create that action in QTP 9.5 and then how to recall that action for all the existing scripts that will use that exact same user id and password. How do you tell 25 existing scripts to call One action if they are run in a batch?
You just need the data (User ID & Password), please add the following function & add it in the resources.

-------------------------------------------------------------------------
Function f_CredT
Browser(b).Page(p).Frame(f).WebEdit(UserID).Set "UID"
Browser(b).Page(p).Frame(f).WebEdit(Password).SetSecure "Encrypted Password"
End Function
-------------------------------------------------------------------------

I hope this will help,

regards,
Nawab
Reply With Quote
  #8 (permalink)  
Old 07-22-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
Re: How to Script Username and Password Using QTP

How exactly do I add it to the resources and where exactly is that? in the (Userid) (Password) parts do I put the actual userid and password here and then where do I insert this entire function in my scripts?

I'm very new to QTP so forgive me.

Look forward to hearing from you soon.

Raymond
Reply With Quote
  #9 (permalink)  
Old 07-22-2008
Junior Member
 
Join Date: Jul 2008
Location: Gaithersburg, MD
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
sbbceo is on a distinguished road
Re: How to Script Username and Password Using QTP

Also do I have to insert this function for every script or is there a way for every script to Automatically call this action without me having to insert it in each one? Let me know exact where to insert this function as well
Reply With Quote
  #10 (permalink)  
Old 07-22-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 164
Thanks: 3
Thanked 11 Times in 11 Posts
NawabShaikh is on a distinguished road
Arrow Re: How to Script Username and Password Using QTP

You need to call this function in all of ur script.


Make sure that across the scripts u have consistency in OR Naming Conventions.....simply call the function as the .vbs resides in resources of all your scripts where ever its needed.


I am not suggesting an Reusable Action as it eats up a lot memory space.

good luck,

Nawab
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
username, password, date and amount puja123 Test Cases 6 12-06-2007 10:21 AM
Host username and password for Oracle 10g supremo Oracle 1 06-25-2007 01:59 AM
Putty screen login and password script dnarsingarao Quality Center 1 05-29-2007 04:43 AM
Prompt the username and password Geek_Guest Networking 1 04-02-2007 01:37 AM
Default username/password for Oracle 8i JobHelper Oracle 4 02-14-2007 01:51 AM


All times are GMT -4. The time now is 06:50 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved