How do you automate the user login to web application ?

In QTP, How can I call different users to logon to a web application under test, one after the other? (In a while loop)
I will appreciate your help.
Thanks,

Questions by Karimnazir   answers by Karimnazir

Editorial / Best Answer

Answered by: srinivas potnuru

  • Jun 13th, 2006


Hi,

there are so many ways

1) Keeping the usernames and passwords in 2 arrays and then looping them

  as below


   usernames =array( "test1","test2","test3" )
   passwords = array ("pass1","pass2","pass3")

   i = 0
   iCount =  ubound(usernames)
   do  While (i <= iCount)   

        'code to set the username password in the application and do the other  steps as well so that u can again enter the username and password  in the application
        i=i+1
   loop

2) Keeping the values in the Datatable and doing the same using datatable functions. 

Showing Answers 1 - 2 of 2 Answers

srinivas potnuru

  • Jun 13th, 2006
 

Hi,

there are so many ways

1) Keeping the usernames and passwords in 2 arrays and then looping them

  as below


   usernames =array( "test1","test2","test3" )
   passwords = array ("pass1","pass2","pass3")

   i = 0
   iCount =  ubound(usernames)
   do  While (i <= iCount)   

        'code to set the username password in the application and do the other  steps as well so that u can again enter the username and password  in the application
        i=i+1
   loop

2) Keeping the values in the Datatable and doing the same using datatable functions. 

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions