public void ATC3349_CRMEntityClientIdentificationArtefactCreateNew() { //3349: Entity: Client Identification Artefact - Create New #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\Clients.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; System.Diagnostics.Debug.WriteLine("testDataRows Present: " + testDataRows.ToString()); int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "ClientTestData") { MyRow = i; break; } } #endregion string clientName = (MyRange.Cells[MyRow, ClientsSchema.GetColumnIndex("CLIENT_NAME")].Value.ToString()); String ClientIdProvided = (MyRange.Cells[MyRow, ClientsSchema.GetColumnIndex("ID_PROVIDED")].Value.ToString()); //Login in as role User user = this.environment.GetUser(SecurityRole.InvestigationsManager); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickClientServicesRibbonButton(); homePage.HoverClientServicesRibbonTab(); homePage.ClickClientsRibbonButton(); ClientsSearchPage clientsSearchPage = new ClientsSearchPage(driver); clientsSearchPage.SetClientSearchText("BLAIR TEST"); Table table = new Table(clientsSearchPage.GetSearchResultTable()); StringAssert.Equals(table.GetCellValue("Full Name", "BLAIR TEST", "Full Name"), "BLAIR TEST"); table.ClickCellValue("Full Name", "BLAIR TEST", "Full Name"); //Navigate to Cient Name homePage.HoverClientXRibbonTab("BLAIR TEST"); homePage.ClickClientXClientIdArtefactRibbonButton(); //Add new Cient Name ClientPage clientPage = new ClientPage(driver); string BaseWindow = driver.CurrentWindowHandle; System.Diagnostics.Debug.WriteLine("BaseWindow handle :" + BaseWindow.ToString()); clientPage.ClickAddNewClientIdArtefact(); string Title = "Client Identification Artefact"; driver = UICommon.SwitchToNewBrowserWithTitle(driver, BaseWindow, Title); //Populate Client Identification Artefact Page ClientIdentificationArtefactPage clientIdentificationArtefactPagePage = new ClientIdentificationArtefactPage(driver); clientIdentificationArtefactPagePage.SetClientIdProvided(ClientIdProvided); clientIdentificationArtefactPagePage.ClickSaveButton(); string FormTitle_Expected = clientName.ToUpper() + ": " + ClientIdProvided; //Get the saved FormTitle Text which gets displayed on the screen after the record is saved. string FormTitle_Actual = clientIdentificationArtefactPagePage.GetFormTitle(ClientIdProvided); System.Diagnostics.Debug.WriteLine("FormTitle_Actual: " + FormTitle_Actual); System.Diagnostics.Debug.WriteLine("FormTitle_Expected: " + FormTitle_Expected); //Assert Client Identification Artefact has saved. Assert.IsTrue(FormTitle_Actual.Equals(FormTitle_Expected), "Actual Form Title does not match the expected (saved) value: " + FormTitle_Expected); //Save and close the Client Identification Artefact Page clientIdentificationArtefactPagePage.ClickSaveCloseButton(); }