public static string GetRole(DriverWrapper driver) { try { GetPOM <BasePageObject>(driver); WebElementWrapper role = driver.GetByXpath("//*[@class='menu_section']/h3", 1); return(role.GetText()); } catch (WebDriverTimeoutException) { return(null); } }
public WebElementWrapper GetByXpath(string xpath, int timeoutInSeconds = 5) { if (timeoutInSeconds > 0) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeoutInSeconds)); var result = new WebElementWrapper(wait.Until(condition: ExpectedConditions.ElementIsVisible(By.XPath(xpath)))); return(result); } else { var result = new WebElementWrapper(driver.FindElement(By.XPath(xpath))); return(result); } }
public override void Init(DriverWrapper driver) { base.Init(driver); language = GetPOM <LanguageChanger>(driver); nameInput = driver.GetByXpath("//input[@id = 'name']"); surnameInput = driver.GetByXpath("//input[@id = 'surname']"); phoneNumberInput = driver.GetByXpath("//input[@id='phone-number']"); password = driver.GetByXpath("//input[@id='password']"); newPassword = driver.GetByXpath("//input[@id='new-password']"); confirmPassword = driver.GetByXpath("//input[@id='password-repeat']"); btnUpdateProfile = driver.GetByXpath("//button[@id='submit-button']"); title = driver.GetByXpath("//div[@class='title_left']//span"); //imageSelect = driver.GetByXpath("//input[@id='image-file']"); }
public override void Init(DriverWrapper driver) { btnSignIn = driver.GetByXpath("//a[@id='Sign_in']", 10); btnSignUp = driver.GetByXpath("//a[@id='Sign_up']", 10); base.Init(driver); }
public string GetRole() { role = driver.GetByXpath("//tbody/tr/td[contains(text(),'*****@*****.**')]/../td[3]"); return(role.GetText()); }
public void ChangeRoleToUser() { btnChangeRole = driver.GetByXpath("//tbody/tr/td[contains(text(),'*****@*****.**')]/../td[6]/button"); btnChangeRole.Click(); SelectRole("user"); }
public bool IsSuccessAlertDisplayed() { successAlert = driver.GetByXpath("//*[@class='alert ui-pnotify-container alert-success ui-pnotify-shadow']"); return(successAlert.IsDisplayed()); }
public bool IsErrorAlertDisplayed() { errorAlert = driver.GetByXpath("//*[@class='alert ui-pnotify-container alert-danger ui-pnotify-shadow']"); return(errorAlert.IsDisplayed()); }
public string GetSuccessText() { WebElementWrapper success = driver.GetByXpath("//h4[@class='ui-pnotify-title']"); return(success.GetText()); }
public string GetXTitleText() { xTitle = driver.GetByXpath("//*[@class='x_title']/h2"); return(xTitle.GetText()); }
public string GetMainPageTitleText() { mainPageTitle = driver.GetByXpath("//*[@data-locale-item='mainPage']/span"); return(mainPageTitle.GetText()); }
public bool GetRole() { role = driver.GetByXpath("//h3[text()='User']"); return(role.IsDisplayed()); }