microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
513 stars 286 forks source link

xrmApp.Entity.Save() is not working -System.InvalidOperationException: 'Save Button is not available' #1266

Closed ritesh035 closed 2 years ago

ritesh035 commented 2 years ago

I have created a blank unit test project and I am facing an issue with record save code.

I have installed the below packages with the latest version and I have built code on dot net version 4.6 1)Dynamics365.UIAutomation.API 2)Selenium.WebDriver.ChromeDriver

Below is code snippet . using (var xrmapp = new XrmApp(client)) { xrmapp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecretKey); xrmapp.Navigation.OpenApp(UCIAppName.Sales); xrmapp.Navigation.OpenSubArea("Sales", "Contacts"); xrmapp.ThinkTime(4000); xrmapp.CommandBar.ClickCommand("New");

            xrmapp.Entity.SetValue("firstname", "test");
            xrmapp.Entity.SetValue("lastname", "contact");

            xrmapp.Entity.Save();

        }

Please correct me in case I have missed anything.

Sekhon92 commented 2 years ago

Hi, Did you find a solution to it? I am struggling with the same problem.