microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
512 stars 285 forks source link

[HOW-TO] encrypt the password in easyrepro framework. ? #1390

Open meeta0311 opened 9 months ago

meeta0311 commented 9 months ago

Question

Currently my password is displaying in app.config for logging into CRM. How can I encrypt my password so that it cannot be revealed to anyone while executing the same regression suite. In short - how to hide password in easyrepro ?

AngelRodriguez8008 commented 9 months ago

@meeta0311

There are many ways to do that, but I am not sure if any is secure enough for your use case. I think it can easily hack, anyway, by for example debugging the code.

  1. is to use SlowCheetah, for Password replacement, in App.Config. Each user should put his own username & password in App.Debug.Config. https://marketplace.visualstudio.com/items?itemName=vscps.SlowCheetah-XMLTransforms-VS2022
  2. there is similar approach if you are using DevOps, Pipelines. https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=azure-devops&tabs=Classic
  3. you can use a TestBase Class & develop your own logic. image

See: https://github.com/microsoft/EasyRepro/blob/develop/Microsoft.Dynamics365.UIAutomation.Sample/UCI/Labs/TestsBase/2_Lab_TestsBase_ReadConfigParameters.cs