Forum Discussion
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.
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_ranabhat9 years agoContributor
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.
- nisgupta9 years agoValued Contributor
Storing the password in external file. is not the recommended option that our department want as in the external file password is not encrypted. Wherever we are storing the password it should be encrypted .
Does Testcomplete has the feature where we can store the password in one place and then all the project suite will access it. Right now I can see the testcomplete allow to define project suite variable but is there something that can be defined outside the project suite .. may be a global variable and all the project suite can access it ?
Please update
Thanks
Nishchal
- cunderw9 years agoCommunity Hero
Create a login keyword test outside of the rest of the projects / suites.
Store your credentials as a variable inside the keyword test (using password for the type of the password variable).
Add the login keyword test as an existing item to all projects that require logging in.
Call that keyword test in all tests.
Now when the credentials change, you can update it in the single keyword tests and all projects that call it will use the new credentials.
Alternatively you could encode the credentials in a text file, environment variable etc... read in the encoded password, and decode it at run time to type it in.