This is a migrated thread and some comments may be shown as answers.

Using a config file to pass user credentials for login during test

2 Answers 347 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jessica
Top achievements
Rank 1
Jessica asked on 27 Oct 2017, 10:27 PM

I currently have various tests, some of them use the login step where you can check encrypt and it will protect the password of the user used. I also have tests that are coded steps and I code the user and password to deal with the login. I would prefer to have a configuration file where I do the username and password as a configuration property that would be used to in the coded steps so that in the event of needing to change the user used for testing I wouldn't have to change it for all the steps. 

 

First off I found the C:\Program Files (x86)\Telerik\Test Studio\Bin config file and I put the following in the configuration tags: 

 <configSections>
<section name="users" type="[namespaceNameHere].UserConfigSection" />
  </configSections>
  <users>
    <add id="1" name="Automated Testing User" username="jessica.gonzales" password="AxkrhLLZjmWbai/5hpEJ6w==" />
<!--<add id="2" name="[Username Description]" username="[username]" password="[safe password]"/>-->
  </users>

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Petrov
Telerik team
answered on 30 Oct 2017, 03:14 PM
Hello Jessica,

Thank you for this question. I could think additionally of two possible approaches to such scenario. First approach could be in a coded step to get the login information from external file that contains credentials and could be changed easily.

Second approach could be to data bind login test to a xml data file for example that could be easily changed as well. 

I hope this directions helps.

Best Regards,
Nikolay Petrov
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Jessica
Top achievements
Rank 1
answered on 31 Oct 2017, 09:48 PM

Thank you Nikolay!

I was making it too complicated, coming from a C# project perspective. The Data Bind step was exactly what I needed to do to accomplish the configuration file.

Best,

Jessica

Tags
General Discussions
Asked by
Jessica
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
Jessica
Top achievements
Rank 1
Share this question
or