Results 1 to 10 of 10

Thread: How to Script Username and Password Using QTP

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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


  2. #2
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    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


  3. #3
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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?


  4. #4
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    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


  5. #5
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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?


  6. #6
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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.


  7. #7
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    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


  8. #8
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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


  9. #9
    Junior Member
    Join Date
    Jul 2008
    Answers
    8

    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


  10. #10
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact