I'm trying to do Automated UI Testing using EasyRepro in Dynamics 365 On-Premise. I managed to the testing with one issue, I can't automatically login to my Dynamics 365 Organization. Below are the code that I used:
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);
xrmApp.Navigation.OpenSubArea("My Work", "Companies");
xrmApp.CommandBar.ClickCommand("New");
xrmApp.Entity.SetValue("name", TestSettings.GetRandomString(5,15));
xrmApp.Entity.Save();
}
When I run it, the newly open chrome page will still ask me to put my credential, after I enter my credential (the CRM username/password), the script will run smoothly.
Since, I plan to use this as part of our automated testing. Is there any way for the EasyRepro to automatically login?
This github issue talks about the login part for on-premise CRM instance automatic login scripting.
I hope you are, but make sure you are using EasyRepro Release Branch - OnPremise repo.
According to the docs, you can add credentials in
app.config
like so:Source: https://github.com/Microsoft/EasyRepro