//See HomePage.cs for explanation of below constructor public ContactUs(WebDriver WebDriver) : base(WebDriver) { WaitForElements.Add(By.Id(_emailId)); WaitForElements.Add(By.Id(_orderId)); WaitForElements.Add(By.Id(_messageId)); WaitForElements.Add(By.Id(_submitId)); }
public void WhenIWaitForElement() { // WaitForElements waitForElements = new WaitForElements(); // WaitForElements.Wait(hooks.Driver, "dng_msg_t"); // WaitForElements.Wait(Hooks.Driver, "dng_msg_t"); WaitForElements.FluentWaitByXpath(Hooks.Driver, "//*[@id='dng_id_t']"); // WaitForElements.FluentWaitWithByClause(Hooks.Driver, By.XPath("//*[@id='dng_id_t']")); // WaitForElements.FluentWaitWithFindElements(Hooks.Driver, Hooks.Driver.FindElement (By.XPath("//*[@id='dng_id_t']"))); }
//See HomePage.cs for explanation of below constructor public SearchResultsPage(WebDriver WebDriver) : base(WebDriver) { WaitForElements.Add(By.Id(_resultsGridId)); }
//See HomePage.cs for explanation of below constructor public ProductPage(WebDriver WebDriver) : base(WebDriver) { WaitForElements.Add(By.XPath(_productNameXPath)); WaitForElements.Add(By.Id(_productConditionId)); WaitForElements.Add(By.Id(_productDescriptionId)); }
public Header(WebDriver WebDriver) : base(WebDriver) { WaitForElements.Add(By.Id(_searchId)); WaitForElements.Add(By.Name(_searchButton)); }
//This shows how the WaitForElements should be structured. //Selenium tends to be friendly with the WebDriverWait.Until on 'By' clauses, but doesn't //work so great with webelements directly. //This implementation works around that limitation by adding all id/xpaths/whatever identifier is used //as a const, so a 'By' can be easily created for all used IWebElements while still using //the [FindsBy] attribute public HomePage(WebDriver WebDriver) : base(WebDriver) { WaitForElements.Add(By.Id(_homeSliderId)); }