This entry assumes that you have or at least you created a trial for Dynamics 365 CRM and signed in.
You can create a trial here: https://port.crm.dynamics.com/G/TrialInstances/TrialInstancePicker.aspx
You need to be System Administrator and System Customizer.
http://josevibriezca.blogspot.com/2020/01/promote-to-admin.html
http://josevibriezca.blogspot.com/2020/01/add-system-customizer-role.html
- Create a project of type Visual C# / Web / ASP.NET Web Application (.NET Framework)".
- Select template MVC for the project.
- Check "Add unit tests" checkbox.
- Open the App.config file located in the test project.
-
In configuration / appSettings paste the following keys (replace the values with your own credentials).
<add key="OnlineUsername" value="name@name.onmicrosoft.com" />
<add key="OnlinePassword" value="*********" />
<add key="OnlineCrmUrl" value="https://testcrm.crm.dynamics.com/" />
<add key="BrowserType" value="Chrome" />
<add key="RemoteBrowserType" value="Chrome" />
<add key="RemoteHubServer" value="http://1.1.1.1:4444/wd/hub" />
- Right click the test project and select "Manage NuGet Packages...".
- Install "Dynamics365.UIAutomation.Api" and "Selenium.Chrome.WebDriver".
- Download and add to the project the last version of the class TestBase from https://github.com/microsoft/EasyRepro/blob/develop/Microsoft.Dynamics365.UIAutomation.Sample/Web/Entity/TestBase.cs.
- Replace the namespace "namespace Microsoft.Dynamics365.UIAutomation.Sample.Web" with your own namespace, example "WebApplication1_EasyRepro_01.Tests".
- Download and add to the project the last version of the class TestSettings from https://github.com/microsoft/EasyRepro/blob/develop/Microsoft.Dynamics365.UIAutomation.Sample/TestSettings.cs.
- Replace the namespace "namespace Microsoft.Dynamics365.UIAutomation.Sample" with your own namespace, example "WebApplication1_EasyRepro_01.Tests".
- Add a new class to the test project. I will call it SomethingToTest.cs but feel free to choose a name that works for you. Use "Microsoft.VisualStudio.TestTools.UnitTesting", add the [TestClass] decorator.
- Make sure to use "public" access modiffier for all test classes you create, other wise will not run.
-
Implement TestInitialize method and one method for each test you want to perform.
No hay comentarios:
Publicar un comentario