microsoft / EasyRepro

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

How to handle authentication login screen specific to a particular organization ? #1380

Open meeta0311 opened 1 year ago

meeta0311 commented 1 year ago

How to handle the below login authenticator screen in easyrepro ? In this case I have to select 'Password' everytime . Once I select the password it will redirect to another popup window in which Password input box will be displayed to enter password. IMG_20230616_103025

AngelRodriguez8008 commented 11 months ago

Hi @meeta0311

You should use Selenium to add your own Custom Login Logic. Using the Driver Instance provided in client.Browser.Driver and replacing in your tests the line xrmApp.OnlineLogin.Login (...),

[TestMethod]
public void UCIDevOpsCreateAccount()
{
    var client = new WebClient(TestSettings.Options);
    using (var xrmApp = new XrmApp(client))
    {
        xrmApp.OnlineLogin.Login(_xrmUri, _username.ToSecureString(), _password.ToSecureString());

        xrmApp.Navigation.OpenApp(UCIAppName.Sales);

        xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

        ...

You don't need to rewrite the Login Logic in each test. You can also create a TestsBase class as show in the Labs Samples

meeta0311 commented 9 months ago

Thank you so much.. it's working for me.