Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
9 years ago

Testcomplete to handle username and password when the password change is required

We have several web applications . All the web applications require the basic authentication - username and password . we need to change the username and password when 60 days is near. We get the notification - change your password as it will expire in xyz days .

 

Now With Testcomplete I am automating those several applications . I have stored the username and password in Project Suite variable. Then I am using in the script as 

 

var username = ProjectSuite.Variables.Username;
var password = ProjectSuite.Variables.Password;

 

Now how Testcomplete handle the change in username and password ? If we have 10 project suites and the username and password is stored in project suite variable and the password expired then how we can handle.

 

Please update 

 

Thanks

NG

9 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    There are several ways you can do this. I would recommend storing the credentials somewhere all projects / suites can access them by creating a shared login utility so you only have to update in one place.

     

    If your tests are all performing the same steps when logging in, that process should not be recreated for each test, that creates a maintenance night-mare, not only for the credentials like you are seeing, but especially if the login process ever changes. 

     

    If you create a shared script or keyword test you will only ever have to make a change once, as opposed to however many different tests are logging into the AUT. 

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Another possible mitigation is to have those modularized login routines that cunderw described pull from a central file containing the username and password.  It would then update the project level variables with the value so that they can continue to function.  So, when you go through the process of changing the password every 60 or 90 days, part of that process would be to update that file so that, immediately, your automation will have the latest and greatest information.  Of course, that presents some security concerns about having passwords stored somewhere unencrypted but there are ways around that as well.

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      As per your statement , I have created the login utility that open the URL and enter the username and password which are pricked from the variables created at the project suite level. I have shared the login utility among the different project suites. But gain if the password changes then I have to go to every project suite to change the password.

       

      How can we store the password unencrypted ? Do Testcomplete has the feature to store the password unencrypted at central place ?

       

      Thanks

      NG

      • shiva_ranabhat's avatar
        shiva_ranabhat
        Contributor

        I think store the Username & Password in an external file (excel, open office etc). Lets say they have columns Username, Password, New Password.

         

        You have your generic function in the project to login. 

        Login(Username, Password){

        // Read from external file

        // Enter Username, Password & Submit

         

        // If your password has expired message{

             Change_Password (Password, New Password)

           }

        // your normal code.. to home page. 

        }

         

        // function to change password

        Change_Password (Current Password, New Password){

          //

        }

         

        This way you will only change your external file's Password & New Password fields every 6 months and don't have modify any TestComplete variables for those many Project suites. 

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      As you mentioned that "storing the credentials somewhere " , what does it mean ? Does testcomplete has the option to store the password outside the project suite ?

       

      Please update

      Thanks

       

  • NisHera's avatar
    NisHera
    Valued Contributor

    To add cunderw and tristaanogre... to handle the notification - "change your password as it will expire in xyz days"

    can write a separate procedure. Could make test to wait for a second to see the notification message come up or not.

    if come up then go through that procedure else not.

    this will delay your test by a second each time, but make sure you do not miss notification message and crash the test.