Ask a Question

Questions about not hard coding Login Credentials in TestComplete


Questions about not hard coding Login Credentials in TestComplete

I am working on some other questions that I have regarding the TestComplete during my evaluation process of the product.


Is there an easy way to create a test script so that the user credentials are not hard coded into the scripts.


textboxUsername SetText "XXXX" Sets the text 'XXXX' in the 'textboxUsername' text editor.
textboxUsername Keys "[Tab]" Enters '[Tab]' in the 'textboxUsername' object.
passwordboxPassword SetText Project.Variables.Password1 Sets the text Project.Variables.Password1 in the 'passwordboxPassword' text editor.
passwordboxPassword SetText Project.Variables.Password2 Sets the text Project.Variables.Password2 in the 'passwordboxPassword' text editor.
passwordboxPassword Keys "[Enter]" Enters '[Enter]' in the 'passwordboxPassword' object.


Now the way the system sets it up is that its hardcoded with a user name and their password.

I want to be able to generate a test where I can setup the code so that the other members on our team will enter their credentials to continue on with

a test?

Champion Level 2

I am not sure I am following this example that was given in the instructions. I am not creating a database I have an environment that references

the table once the user credentials already entered. 

So I could be the person entering my credentials including user name and password the system automatically references my privilege's 

and then I want to create the test so that the individual who is using this test can enter their credentials and then continue on with the test. So basically

it could be anyone on our team who is using these tests.



If I got your question right...

If you want to get password that is used when you are logging-in into your computer (i.e. your local system or domain password) then I am far not sure that this is possible at all.


  /Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.

That is the best way to describe it. The user name and password are my Domain User Name and Password where I have been given the rights

to enter my User Name and Password information onto the environment which I am using to test the Website.

You will need to have your test navigate to the login page where you normally enter your credentials and then have the test


1) wait for a long enough time to let someone log in

2) watch for either the Login Failure page or the next page that would be there if the login is successful.

Do you have some sample code of this because I am going to want to be able to do this with TestComplete.

What you can do is walk through those logging in steps manually and have TestComplete record them in a test for you.  Then you can add that part to an existing test or add other steps to it.


Try this and let us know if you have questions.

Showing results for 
Search instead for 
Did you mean: