public void TestCreateNewAccount() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView("Active Accounts"); xrmBrowser.ThinkTime(1000); xrmBrowser.CommandBar.ClickCommand("New"); xrmBrowser.ThinkTime(4000); xrmBrowser.Entity.SetValue("name", "Test API Account"); xrmBrowser.Entity.SetValue("telephone1", "555-555-5555"); xrmBrowser.Entity.SetValue("websiteurl", "https://easyrepro.crm.dynamics.com"); xrmBrowser.CommandBar.ClickCommand("Save & Close"); xrmBrowser.ThinkTime(2000); } }
public void TestTakeScreenshot() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); ScreenshotImageFormat fileFormat = ScreenshotImageFormat.Tiff; // Image Format -> Png, Jpeg, Gif, Bmp and Tiff. xrmBrowser.TakeWindowScreenShot("D:\\Screenshot" + "." + fileFormat, fileFormat); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView("Active Accounts"); xrmBrowser.ThinkTime(1000); xrmBrowser.CommandBar.ClickCommand("New"); xrmBrowser.ThinkTime(4000); xrmBrowser.Entity.SetValue("name", "Test API Account"); xrmBrowser.Entity.SetValue("telephone1", "555-555-5555"); xrmBrowser.Entity.SetValue("websiteurl", "https://easyrepro.crm.dynamics.com"); xrmBrowser.CommandBar.ClickCommand("Save & Close"); xrmBrowser.ThinkTime(2000); } }
public void TestsCrmAsyncRequestResponseSample() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); // Navigate to the app by selecting the AsyncRequestResponseSample app in the app list var id = "TabArrowDivider"; xrmBrowser.Driver.ClickWhenAvailable(By.Id(id)); xrmBrowser.ThinkTime(5000); // not sure why I need think time here, but I get an exception otherwise. // Need to see if there is a better way to consistently select the app from the list by app name. For now using XPath... var xpath = "//*[@id='taskpane-scroll-container']/div[3]/button[1]"; var appElement = xrmBrowser.Driver.FindElement(By.XPath(xpath)); // Tried ClicWhenAvailable, but it failed sporadically appElement.Click(); // Create a new record and save xrmBrowser.ThinkTime(5000); // not sure why I need think time here, but I get an exception otherwise. xrmBrowser.CommandBar.ClickCommand("New"); var guid = Guid.NewGuid().ToString(); xrmBrowser.Entity.SetValue("dkdt_name", guid); xrmBrowser.CommandBar.ClickCommand("Save"); // Verify web resource contents after message comes back from Azure xrmBrowser.Document.SwitchToContentFrame(); xrmBrowser.Driver.SwitchTo().Frame("WebResource_CheckForUpdateFromAzureCode"); var wait = new WebDriverWait(xrmBrowser.Driver, TimeSpan.FromSeconds(35)); wait.Until(d => d.FindElement(By.Id("status")).Text.Contains("Azure code updated entity.")); } }
public void TestInvalidRelatedClickCommand() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(3000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Navigation.OpenRelated("Cases"); xrmBrowser.Related.Sort("createdo1n"); xrmBrowser.Related.SwitchView("Active Cases"); xrmBrowser.Related.Search("F"); xrmBrowser.Related.ClickCommand("ADD"); xrmBrowser.QuickCreate.Cancel(); xrmBrowser.ThinkTime(2000); } }
public void TestUpdateContact() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); var perf = xrmBrowser.PerformanceCenter; if (!perf.IsEnabled) { perf.IsEnabled = true; } xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea(Reference.Localization.Sales, Reference.Localization.Contacts); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView(Reference.Localization.ActiveContacts); xrmBrowser.ThinkTime(1000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Entity.SetValue("emailaddress1", "*****@*****.**"); xrmBrowser.Entity.SetValue("mobilephone", "123-222-4444"); xrmBrowser.Entity.SetValue("birthdate", DateTime.Parse("12/2/1984")); xrmBrowser.Entity.Save(); xrmBrowser.ThinkTime(5000); } }
public void TestCreateNewCase() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(3000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Navigation.OpenRelated("Cases"); xrmBrowser.Related.SwitchView("Active Cases"); xrmBrowser.ThinkTime(2000); xrmBrowser.Related.ClickCommand("ADD NEW CASE"); xrmBrowser.ThinkTime(2000); xrmBrowser.QuickCreate.SetValue("title", "Test API Case"); xrmBrowser.QuickCreate.Save(); xrmBrowser.ThinkTime(10000); } }
public void TestUpdateCase() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(3000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Navigation.OpenRelated("Cases"); xrmBrowser.Related.SwitchView("Active Cases"); xrmBrowser.ThinkTime(2000); xrmBrowser.Related.OpenGridRow(0); xrmBrowser.ThinkTime(2000); xrmBrowser.Entity.SetValue(new OptionSet { Name = "caseorigincode", Value = "Email" }); xrmBrowser.Entity.Save(); xrmBrowser.ThinkTime(10000); } }
public void TestUpdateCase() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.PerformanceCenter.IsEnabled = true; xrmBrowser.Navigation.OpenSubArea(Reference.Localization.Sales, Reference.Localization.Accounts); xrmBrowser.ThinkTime(3000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Navigation.OpenRelated(Reference.Localization.Cases); xrmBrowser.Related.SwitchView(Reference.Localization.ActiveCases); xrmBrowser.ThinkTime(2000); xrmBrowser.Related.OpenGridRow(0); xrmBrowser.ThinkTime(2000); xrmBrowser.Entity.SetValue(new OptionSet { Name = "caseorigincode", Value = "Email" }); xrmBrowser.Entity.Save(); xrmBrowser.ThinkTime(5000); } }
public void TestCreateNewOpportunity() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Opportunities"); xrmBrowser.ThinkTime(200); xrmBrowser.Grid.SwitchView("Open Opportunities"); xrmBrowser.ThinkTime(1000); xrmBrowser.CommandBar.ClickCommand("New"); xrmBrowser.ThinkTime(5000); xrmBrowser.Entity.SetValue("name", "Test API Opportunity"); xrmBrowser.Entity.SetValue("description", "Testing the create api for Opportunity"); xrmBrowser.CommandBar.ClickCommand("Save"); xrmBrowser.ThinkTime(2000); } }
public void TestCreateNewLead() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.Navigation.OpenSubArea(Reference.Localization.Sales, Reference.Localization.Leads); xrmBrowser.CommandBar.ClickCommand(Reference.Localization.New); xrmBrowser.ThinkTime(2000); List <Field> fields = new List <Field> { new Field { Id = "firstname", Value = "Test" }, new Field { Id = "lastname", Value = "Lead" } }; xrmBrowser.Entity.SetValue("subject", "Test API Lead"); xrmBrowser.Entity.SetValue(new CompositeControl { Id = "fullname", Fields = fields }); xrmBrowser.Entity.SetValue("mobilephone", "555-555-5555"); xrmBrowser.Entity.SetValue("description", "Test lead creation with API commands"); xrmBrowser.CommandBar.ClickCommand(Reference.Localization.Save); xrmBrowser.ThinkTime(5000); } }
public void RunSmokeTest() { using (var xrmBrowser = new XrmBrowser(_options)) { try { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts"); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView("Active Contacts"); xrmBrowser.ThinkTime(1000); xrmBrowser.CommandBar.ClickCommand("New"); xrmBrowser.ThinkTime(5000); string firstname = "Wael"; string lastname = "Test"; string tel = new Random().Next(200000000, 300000000).ToString(); var fields = new List <Field> { new Field() { Id = "firstname", Value = firstname }, new Field() { Id = "lastname", Value = lastname } }; xrmBrowser.Entity.SetValue(new CompositeControl() { Id = "fullname", Fields = fields }); xrmBrowser.Entity.SetValue("emailaddress1", "*****@*****.**"); xrmBrowser.Entity.SetValue("mobilephone", tel); xrmBrowser.Entity.SetValue("birthdate", DateTime.Parse("11/1/1980")); xrmBrowser.Entity.SetValue(new OptionSet { Name = "preferredcontactmethodcode", Value = "Email" }); xrmBrowser.CommandBar.ClickCommand("Save"); xrmBrowser.ThinkTime(5000); } finally { string screenShot = string.Format("{0}\\SmokeTest_Final.jpeg", TestContext.TestResultsDirectory); xrmBrowser.TakeWindowScreenShot(screenShot, ScreenshotImageFormat.Jpeg); TestContext.AddResultFile(screenShot); } } }
public void TestInvalidOpenEntity() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Entity.OpenEntity(TestSettings.InvalidAccountLogicalName, Guid.Parse(TestSettings.AccountId)); xrmBrowser.ThinkTime(5000); } }
public void TestCloseNotifications() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Notifications.CloseNotifications(); xrmBrowser.ThinkTime(4000); } }
public void TestOpenOptOutOfLearningPath() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenOptOutLearningPath(); xrmBrowser.ThinkTime(1000); } }
public void TestOpenAppsforDynamicsCRM() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenAppsForDynamicsCRM(); xrmBrowser.ThinkTime(1000); } }
public void TestOpenSeeWelcomeScreen() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenWelcomeScreen(); xrmBrowser.ThinkTime(1000); } }
public void TestSelectTab() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Entity.OpenEntity(TestSettings.AccountLogicalName, Guid.Parse(TestSettings.AccountId)); xrmBrowser.ActivityFeed.SelectTab(Api.Pages.XrmActivityFeedPage.Tab.Activities); xrmBrowser.ThinkTime(5000); } }
public void TestOpenRecord() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.GlobalSearch(""); xrmBrowser.GlobalSearch.Search("Contoso"); xrmBrowser.GlobalSearch.OpenRecord("Accounts", 0); xrmBrowser.ThinkTime(4000); } }
public void TestInvalidSwitchView() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(100); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.Grid.SwitchView("Open Accounts"); xrmBrowser.ThinkTime(1000); } }
public void TestValidateVersion() { var validAppVersion = "8.2.1.360"; var validDBVersion = "8.2.1.360"; using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenAbout(); xrmBrowser.Driver.LastWindow().SwitchTo().ActiveElement(); var dbVersion = xrmBrowser.Document.getElementByXPath("id(\"PageBody\")/table/tbody/tr[1]/td[2]/div/bdo[3]").Text; var appVersion = xrmBrowser.Document.getElementByXPath("id(\"PageBody\")/table/tbody/tr[1]/td[2]/div/bdo[2]").Text.Replace("(", "").Replace(")", ""); if (dbVersion != validDBVersion) { throw new Exception($"The database verion ({dbVersion}) is not valid for this org. The version should be {validDBVersion}"); } if (appVersion != validAppVersion) { throw new Exception($"The application verion ({appVersion}) is not valid for this org. The version should be {validAppVersion}"); } } }
public void TestInvalidRelatedArea() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.ThinkTime(3000); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Navigation.OpenRelated("Case"); } }
public void TestOpenActiveOpportunity() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea(Reference.Localization.Sales, Reference.Localization.Opportunities); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView(Reference.Localization.OpenOpportunities); xrmBrowser.Grid.OpenRecord(0); } }
public void TestOpenAbout() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenAbout(); xrmBrowser.Driver.LastWindow().Close(); xrmBrowser.ThinkTime(1000); } }
public void TestExpandTab() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Entity.OpenEntity(TestSettings.AccountLogicalName, Guid.Parse(TestSettings.AccountId)); xrmBrowser.Entity.CollapseTab("Summary"); xrmBrowser.Entity.ExpandTab("Summary"); xrmBrowser.ThinkTime(5000); } }
public void TestAddTask() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Entity.OpenEntity(TestSettings.AccountLogicalName, Guid.Parse(TestSettings.AccountId)); xrmBrowser.ActivityFeed.SelectTab(Api.Pages.XrmActivityFeedPage.Tab.Activities); xrmBrowser.ActivityFeed.AddTask("Schedule an appointment", "Capture preliminary customer and product information.", DateTime.Now, new OptionSet { Name = "quickCreateActivity4212controlId_prioritycode_d", Value = "Normal" }); xrmBrowser.ThinkTime(4000); } }
public void TestAddAppointment() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Entity.OpenEntity(TestSettings.AccountLogicalName, Guid.Parse(TestSettings.AccountId)); xrmBrowser.ActivityFeed.SelectTab(Api.Pages.XrmActivityFeedPage.Tab.Activities); xrmBrowser.ActivityFeed.AddAppointment(); xrmBrowser.Entity.SetValue("subject", "Add Appointment"); xrmBrowser.CommandBar.ClickCommand("Save"); xrmBrowser.ThinkTime(2000); } }
public void TestCreateNewContact() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseTrialBubble(); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts"); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView("Active Contacts"); xrmBrowser.ThinkTime(1000); xrmBrowser.CommandBar.ClickCommand("New"); xrmBrowser.ThinkTime(5000); var fields = new List <Field> { new Field() { Id = "firstname", Value = "Test" }, new Field() { Id = "lastname", Value = "Contact" } }; xrmBrowser.Entity.SetValue(new CompositeControl() { Id = "fullname", Fields = fields }); xrmBrowser.Entity.SetValue("emailaddress1", "*****@*****.**"); xrmBrowser.Entity.SetValue("mobilephone", "555-555-5555"); xrmBrowser.Entity.SetValue("birthdate", DateTime.Parse("11/1/1980")); xrmBrowser.Entity.SetValue(new OptionSet { Name = "preferredcontactmethodcode", Value = "Email" }); xrmBrowser.CommandBar.ClickCommand("Save"); xrmBrowser.ThinkTime(5000); } }
public void TestOpenPrivacyStatement() { //Only available on Admin Users using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts"); xrmBrowser.Grid.SwitchView("Active Accounts"); xrmBrowser.Grid.SelectRecord(1); xrmBrowser.Navigation.OpenPrivacyStatement(); xrmBrowser.ThinkTime(1000); } }
public void TestNavigateDown() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.ThinkTime(500); xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts"); xrmBrowser.ThinkTime(2000); xrmBrowser.Grid.SwitchView("Active Contacts"); xrmBrowser.Grid.OpenRecord(0); xrmBrowser.Entity.NavigateDown(); xrmBrowser.ThinkTime(5000); } }
public void TestOpenCreate() { using (var xrmBrowser = new XrmBrowser(TestSettings.Options)) { xrmBrowser.LoginPage.Login(_xrmUri, _username, _password); xrmBrowser.GuidedHelp.CloseGuidedHelp(); xrmBrowser.Navigation.QuickCreate(Reference.Localization.Contact); xrmBrowser.ThinkTime(2000); xrmBrowser.QuickCreate.SetValue("lastname", "Contact"); xrmBrowser.QuickCreate.SetValue("firstname", "Test Quick Create"); xrmBrowser.QuickCreate.Save(); xrmBrowser.ThinkTime(5000); } }