public static void SetText(string text) { var editControl = new HtmlEdit(browserWindow); try { editControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue; editControl.WaitForControlEnabled(); editControl.WaitForControlReady(); } catch (Exception) { Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found"); } editControl.Text = text; }
private static HtmlDocument EnterCredentialsAndSignIn(BrowserWindow browser, HtmlDocument page, string login, string password) { // Check if there is a login user chooser (some identity already logged-in) HtmlControl loginUserChooser = new HtmlControl(page); loginUserChooser.SearchProperties[HtmlEdit.PropertyNames.Id] = "login_user_chooser"; loginUserChooser.TryFind(); if (loginUserChooser.Exists) { HtmlTable chooseAnotherAccount = new HtmlTable(loginUserChooser); chooseAnotherAccount.SearchProperties[HtmlTable.PropertyNames.Id] = "use_another_account"; chooseAnotherAccount.TryFind(); if (chooseAnotherAccount.Exists) { Mouse.Click(chooseAnotherAccount); } } // Enter the login and password HtmlEdit loginTextBox = new HtmlEdit(page); loginTextBox.SearchProperties[HtmlEdit.PropertyNames.Id] = "cred_userid_inputtext"; loginTextBox.Text = login; loginTextBox.WaitForControlReady(); // The page can be refreshed. page = new HtmlDocument(browser); HtmlEdit passwordTextBox = new HtmlEdit(page); passwordTextBox.SearchProperties[HtmlEdit.PropertyNames.Id] = "cred_password_inputtext"; passwordTextBox.EnsureClickable(); passwordTextBox.Password = password; HtmlControl signInButton = new HtmlControl(page); signInButton.SearchProperties[HtmlControl.PropertyNames.Id] = "cred_sign_in_button"; Mouse.Click(signInButton); // Get the new page page = new HtmlDocument(browser); return(page); }
public void CreateOfficeFund() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //select Funding Tab HtmlHyperlink offFund = new HtmlHyperlink(browserWindow); offFund.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Funding", HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.TagInstance, "22"); offFund.WaitForControlReady(); Assert.AreEqual(true, offFund.Exists); Mouse.Click(offFund); //Add Outgoing Funding Item*** // //TestPropertyAttribute? var config = new AddFundConfig(); config.FiscalYear = DateTime.Now.Year; config.SourceRecipientTypeName = MoneyFlowSourceRecipientType.Project.Value; config.SearchRecipient = "Cultural Heritage Center"; OutgoingFund.AddFundOut(browserWindow, config); IncomingFund.AddFundIn(browserWindow); }
public static void SetText(string text) { var editControl = new HtmlEdit(browserWindow); try { editControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue; editControl.WaitForControlEnabled(); editControl.WaitForControlReady(); } catch (Exception) { Assert.Fail("Failed to find "+CSVReader.ControlType+" Element - Element not Found"); } editControl.Text = text; }
public void ViewOffices_ProgramsandBranches() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //verify chcOffice overview HtmlDiv chcOffHeader = new HtmlDiv(browserWindow); chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15"); chcOffHeader.WaitForControlReady(); Assert.AreEqual(true, chcOffHeader.Exists); //verify description HtmlDiv chcOffDescription = new HtmlDiv(browserWindow); chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31"); chcOffDescription.WaitForControlReady(); Assert.AreEqual(true, chcOffDescription.Exists); //verify themes HtmlDiv chcOffThemes = new HtmlDiv(browserWindow); chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffThemes.WaitForControlReady(); Assert.AreEqual(true, chcOffThemes.Exists); //Html chcOffThemes = new HtmlPane(browserWindow); //chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Civilian Security Conflict Prevention, Mitigation, and Response Democracy/Good Governance/Rule of Law Diversity Entrepreneurship/Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well-Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35", HtmlControl.PropertyNames.ControlType, "Pane"); //chcOffThemes.WaitForControlReady(); //Assert.AreEqual(true, chcOffThemes.Exists); //verify goals HtmlDiv chcOffGoals = new HtmlDiv(browserWindow); chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights", HtmlDiv.PropertyNames.TagInstance, "38", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffGoals.WaitForControlReady(); Assert.AreEqual(true, chcOffGoals.Exists); //verify POC(s) HtmlDiv chcOffPoc = new HtmlDiv(browserWindow); chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45", HtmlControl.PropertyNames.ControlType, "Pane"); chcOffPoc.WaitForControlReady(); Assert.AreEqual(true, chcOffPoc.Exists); //select branches and programs tab HtmlHyperlink chcBranchProgTab = new HtmlHyperlink(browserWindow); chcBranchProgTab.SearchProperties.Add(HtmlHyperlink.PropertyNames.TagName, "A", HtmlHyperlink.PropertyNames.InnerText, "Branches & Programs", HtmlHyperlink.PropertyNames.TagInstance, "19"); chcBranchProgTab.WaitForControlReady(); Assert.AreEqual(true, chcBranchProgTab.Exists); Mouse.Click(chcBranchProgTab); //Identify Showing # - # of ## //HtmlDiv showBPList = new HtmlDiv(browserWindow); //showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 -", PropertyExpressionOperator.Contains, HtmlDiv.PropertyNames.TagInstance, "33"); //showBPList.WaitForControlReady(); //Assert.AreEqual(true, showBPList.Exists); //verify branches and programs tab section var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False"; using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var start = 0; var limit = 10; //var officeId = 1036; var defaultSorter = new ExpressionSorter <OrganizationProgramDTO>(x => x.Name, SortDirection.Ascending); var queryOperator = new QueryableOperator <OrganizationProgramDTO>(start, limit, defaultSorter); var results = service.GetPrograms(1036, queryOperator); var expectedString = String.Format("Showing {0} - {1} of {2} programs", start + 1, limit, results.Total); //Identify Showing # - # of ## HtmlDiv showBPList = new HtmlDiv(browserWindow); showBPList.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, expectedString, HtmlDiv.PropertyNames.TagInstance, "33"); showBPList.WaitForControlReady(); Assert.AreEqual(true, showBPList.Exists); Assert.AreEqual(expectedString, showBPList.InnerText); } }
public void ViewOfficesPage() { /* var defaultSorter = new ExpressionSorter<SimpleOfficeDTO>(x => x.Name, SortDirection.Ascending); * var nameFilter = new ExpressionFilter<SimpleOfficeDTO>(x => x.Name, ComparisonType.Like, "Cultural Heritage"); * var queryOperator = new QueryableOperator<SimpleOfficeDTO>(0, 100, defaultSorter, new List<IFilter> { nameFilter }, null); * * var dtos = officeService.GetOffices(queryOperator); * var testOffice = dtos.Results.First(); * var searchText = testOffice.Name; * var linkText = testOffice.Name; * var total = dtos.Total; */ var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //showingOff DB Verify-- use sql connection for verifying the office count var connectionString = "Data Source=(local);User Id=ECA;Password=wisconsin-89;Database=ECA_Local;Pooling=False"; using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var start = 0; var limit = 25; var defaultSorter = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending); var queryOperator = new QueryableOperator <SimpleOfficeDTO>(0, 25, defaultSorter); var results = service.GetOffices(queryOperator); var expectedString = String.Format("Showing {0} - {1} of {2} offices", start + 1, limit, results.Total); //showing count HtmlDiv showingOff = new HtmlDiv(browserWindow); showingOff.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Showing 1 - 25 of 56 offices"); showingOff.WaitForControlReady(); Assert.AreEqual(true, showingOff.Exists); Assert.AreEqual(expectedString, showingOff.InnerText); } //verify the view count of Offices with Cultural in the name using (var context = new EcaContext(connectionString)) using (var service = new OfficeService(context)) { var defaultSorter = new ExpressionSorter <SimpleOfficeDTO>(x => x.OfficeSymbol, SortDirection.Ascending); var set = new HashSet <string>(); set.Add("Cultural"); var keywordfilter = new SimpleKeywordFilter <SimpleOfficeDTO>(set, x => x.Name, x => x.Description, x => x.OfficeSymbol); var queryOperator = new QueryableOperator <SimpleOfficeDTO>(0, 10, defaultSorter, new List <IFilter> { keywordfilter }); var results = service.GetOffices(queryOperator); Assert.AreEqual(results.Total, 9); } //old code /* this.UIMap.LogintoQA_ExistingUser(); * //this.UIMap.LogintoQA(); * this.UIMap.AssertContentMenuButton(); * this.UIMap.SelectContentMenuButton(); * this.UIMap.AssertOfficesContentMenuLink(); * this.UIMap.SelectOfficesContentMenuLink(); * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.SelectContentMenuButton(); * this.UIMap.SelectOfficesContentMenu_Link(); * //this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.AssertECAOfficeDirectoryPage(); * this.UIMap.AssertSearchOffices(); * this.UIMap.InputSearchOfficeText(); * this.UIMap.RefreshAllOffices_ECAOfficeDirectoryPage(); * this.UIMap.InputSearchOfficeText(); * this.UIMap.AssertSearchOfficesTextResults(); * this.UIMap.AssertAvailableOfficeinList(); * //this.UIMap.AssertOfficeAvailableinList(); * this.UIMap.CloseBrowserWindow(); */ //end old code }
public static void AddFundIn(BrowserWindow browserWindow) { //add funding item prop HtmlButton addNewFund = new HtmlButton(browserWindow); addNewFund.SearchProperties.Add(HtmlButton.PropertyNames.TagName, "BUTTON", HtmlButton.PropertyNames.InnerText, "ADD FUNDING ITEM", HtmlButton.PropertyNames.TagInstance, "3"); addNewFund.WaitForControlReady(); Assert.AreEqual(true, addNewFund.Exists); //select add funding item Mouse.Click(addNewFund); //outgoing tab prop (modal) HtmlSpan Incoming = new HtmlSpan(browserWindow); Incoming.SearchProperties.Add(HtmlSpan.PropertyNames.TagName, "SPAN", HtmlSpan.PropertyNames.InnerText, "Incoming", HtmlSpan.PropertyNames.TagInstance, "44"); Incoming.WaitForControlReady(); Assert.AreEqual(true, Incoming.Exists); //select outgoing tab Mouse.Click(Incoming); // office outgoing modal props // //Status*** //status label HtmlLabel Status = new HtmlLabel(browserWindow); Status.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Status *", HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.TagInstance, "15"); Status.WaitForControlReady(); Assert.AreEqual(true, Status.Exists); //status field HtmlComboBox StatusField = new HtmlComboBox(browserWindow); StatusField.SearchProperties.Add(HtmlComboBox.PropertyNames.TagName, "SELECT", HtmlComboBox.PropertyNames.Id, "moneyFlowStatus", HtmlComboBox.PropertyNames.InnerText, "ActualAppropriatedEstimated", HtmlComboBox.PropertyNames.TagInstance, "3"); StatusField.WaitForControlReady(); Assert.AreEqual(true, StatusField.Exists); //Transaction date*** //transaction date label HtmlLabel TransDTE = new HtmlLabel(browserWindow); TransDTE.SearchProperties.Add(HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.InnerText, "Transaction Date *", HtmlLabel.PropertyNames.TagInstance, "16"); TransDTE.WaitForControlReady(); Assert.AreEqual(true, TransDTE.Exists); //transaction date field HtmlEdit TransDTEField = new HtmlEdit(browserWindow); TransDTEField.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.Name, "transactionDate", HtmlEdit.PropertyNames.TagInstance, "22"); TransDTEField.WaitForControlReady(); Assert.AreEqual(true, TransDTEField.Exists); //transaction date picker calendar HtmlButton TransDTECal = new HtmlButton(browserWindow); TransDTECal.SearchProperties.Add(HtmlButton.PropertyNames.TagName, "BUTTON", HtmlButton.PropertyNames.InnerText, "event", HtmlButton.PropertyNames.TagInstance, "13"); TransDTECal.WaitForControlReady(); Assert.AreEqual(true, TransDTECal.Exists); //Reference Fiscal Year*** //reference fiscal year label HtmlLabel RefFY = new HtmlLabel(browserWindow); RefFY.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Reference Fiscal Year *", HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.TagInstance, "17"); RefFY.WaitForControlReady(); Assert.AreEqual(true, RefFY.Exists); //reference fiscal year field HtmlEdit RefFYField = new HtmlEdit(browserWindow); RefFYField.SearchProperties.Add(HtmlEdit.PropertyNames.Id, "fiscalYear", HtmlEdit.PropertyNames.TagName, "SELECT", HtmlEdit.PropertyNames.InnerText, "2005200620072008200920102011201220132014201520162017", HtmlEdit.PropertyNames.TagInstance, "4"); RefFYField.WaitForControlReady(); Assert.AreEqual(true, RefFYField.Exists); //select funding source name label HtmlLabel SelectSource = new HtmlLabel(browserWindow); SelectSource.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Select a Funding Item that will be the Source for the new Funding Item", PropertyExpressionOperator.Contains); SelectSource.WaitForControlReady(); //select source funding field HtmlCustom FundSource = new HtmlCustom(browserWindow); FundSource.SearchProperties.Add(HtmlCustom.PropertyNames.InnerText, "Select a source funding item...", PropertyExpressionOperator.Contains); FundSource.WaitForControlReady(); //remaining unassigned funds label HtmlLabel RemainingFunds = new HtmlLabel(browserWindow); RemainingFunds.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Remaining Unassigned Funds From Source", PropertyExpressionOperator.Contains); RemainingFunds.WaitForControlReady(); //NEED TO MATCH THE SOURCE NAME DISPLAYED TO THE ONE ABOVE WHEN SELECTED TO VERIFY //funding amount label HtmlLabel Amount = new HtmlLabel(browserWindow); Amount.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Amount *"); Amount.WaitForControlReady(); Assert.AreEqual(true, Amount.Exists); //funding amount field HtmlEdit AmountField = new HtmlEdit(browserWindow); AmountField.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.Id, "amount"); AmountField.WaitForControlReady(); Assert.AreEqual(true, AmountField.Exists); //description label HtmlLabel Description = new HtmlLabel(browserWindow); Description.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Description *"); Description.WaitForControlReady(); Assert.AreEqual(true, Description.Exists); //description field HtmlEdit DescField = new HtmlEdit(browserWindow); DescField.SearchProperties.Add(HtmlEdit.PropertyNames.Id, "description"); DescField.WaitForControlReady(); Assert.AreEqual(true, DescField.Exists); //save button HtmlButton SaveFund = new HtmlButton(browserWindow); SaveFund.SearchProperties.Add(HtmlButton.PropertyNames.InnerText, "Save", HtmlButton.PropertyNames.TagName, "BUTTON"); SaveFund.WaitForControlReady(); Assert.AreEqual(true, SaveFund.Exists); //cancel button HtmlButton CancelFund = new HtmlButton(browserWindow); CancelFund.SearchProperties.Add(HtmlButton.PropertyNames.InnerText, "Cancel", HtmlButton.PropertyNames.TagName, "BUTTON"); CancelFund.WaitForControlReady(); Assert.AreEqual(true, CancelFund.Exists); //END MODAL PROPS }
public void ViewOfficesOverviewCodedUITestMethod1() { var browserWindow = AuthHelper.KMTLogin(); ContentMenu.AccessMenu(browserWindow); //select offices section HtmlHyperlink offices = new HtmlHyperlink(browserWindow); offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2"); offices.WaitForControlReady(); Mouse.Click(offices); //Verify office directory HtmlDiv officeDirect = new HtmlDiv(browserWindow); officeDirect.SearchProperties.Add(HtmlDiv.PropertyNames.InnerText, "ECA Office Directory", HtmlDiv.PropertyNames.TagName, "DIV"); officeDirect.WaitForControlReady(); Assert.AreEqual(true, officeDirect.Exists); //search field HtmlEdit offSearch = new HtmlEdit(browserWindow); offSearch.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.ControlType, "Edit", HtmlEdit.PropertyNames.TagInstance, "1"); offSearch.WaitForControlReady(); Assert.AreEqual(true, offSearch.Exists); //execute search Mouse.Click(offSearch); offSearch.Text = "Cultural Heritage Center"; //verify office in results "Cultural Heritage Center" HtmlHyperlink chcOffice = new HtmlHyperlink(browserWindow); chcOffice.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Cultural Heritage Center", HtmlHyperlink.PropertyNames.TagInstance, "17"); chcOffice.WaitForControlReady(); Assert.AreEqual(true, chcOffice.Exists); //select chcOffice Mouse.Click(chcOffice); //verify chcOffice overview HtmlDiv chcOffHeader = new HtmlDiv(browserWindow); chcOffHeader.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "OFFICE Cultural Heritage Center ECA/P/C Permalink: http://localhost:5556/#/offices/1036/overview#top", HtmlDiv.PropertyNames.TagInstance, "15"); chcOffHeader.WaitForControlReady(); Assert.AreEqual(true, chcOffHeader.Exists); //verify description HtmlDiv chcOffDescription = new HtmlDiv(browserWindow); chcOffDescription.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "The Cultural Heritage Center supports the protection and preservation of cultural heritage and serves as a center of expertise on global cultural heritage protection issues. The Center administers U.S. responsibilities related to the 1970 UNESCO Convention on the Means of Prohibiting and Preventing the Illicit Import, Export, and Transfer of Ownership of Cultural Property, including the Cultural Property Advisory Committee and bilateral agreements; the U.S. Ambassadors Fund for Cultural Preservation (AFCP); the Cultural Antiquities Task Force; and efforts to coordinate protection and preservation of cultural heritage in disaster situations.", HtmlDiv.PropertyNames.TagInstance, "31"); chcOffDescription.WaitForControlReady(); Assert.AreEqual(true, chcOffDescription.Exists); //verify themes HtmlDiv chcOffThemes = new HtmlDiv(browserWindow); chcOffThemes.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Themes American Studies Arts Arts & Culture Civilian Security Conflict Prevention, Mitigation, and Response Democracy / Good Governance / Rule of Law Diversity Entrepreneurship / Job Creation Environment Humanitarian Assistance, Disaster Mitigation Markets and Competitiveness Sustainable Economic Growth & Well - Being Trade & Investment Transitions in Frontline States Transnational Threats - Crime, Narcotics, Trafficking in Person Travel and Tourism", HtmlDiv.PropertyNames.TagInstance, "35"); chcOffThemes.WaitForControlReady(); Assert.AreEqual(true, chcOffThemes.Exists); //verify goals HtmlDiv chcOffGoals = new HtmlDiv(browserWindow); chcOffGoals.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Goals Democracy and Human Rights Economic Development Global Economic Growth", HtmlDiv.PropertyNames.TagInstance, "38"); chcOffGoals.WaitForControlReady(); Assert.AreEqual(true, chcOffGoals.Exists); //verify POC(s) HtmlDiv chcOffPoc = new HtmlDiv(browserWindow); chcOffPoc.SearchProperties.Add(HtmlDiv.PropertyNames.TagName, "DIV", HtmlDiv.PropertyNames.InnerText, "Points of Contact Cultural Heritage Center Main Line Maria Kouroupas", HtmlDiv.PropertyNames.TagInstance, "45"); chcOffPoc.WaitForControlReady(); Assert.AreEqual(true, chcOffPoc.Exists); //old code //this.UIMap.LogintoQA_existing(); //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu(); ////this.UIMap.NavigatetoECAOfficeDirectory(); //this.UIMap.RefreshBrowser(); //this.UIMap.NavigatetoECAOfficeDirectory_viaContentMenu(); //this.UIMap.AssertAllOfficesBanner(); //this.UIMap.AssertSearchOfficesTextBox(); //this.UIMap.SearchBox_textinput(); //this.UIMap.RefreshBrowser(); //this.UIMap.SearchBox_textinput(); //this.UIMap.AssertSearchShowingResults(); //this.UIMap.AssertSearchResultTopList(); //this.UIMap.CloseBrowserWindow(); //// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. }