List of usage examples for org.openqa.selenium By name
public static By name(String name)
From source file:com.hotwire.selenium.desktop.us.billing.AbstractBillingPage.java
License:Open Source License
public void selectAsGuest() { List<WebElement> continueAsGuest = getWebDriver().findElements(By.name(CONTINUE_AS_GUEST_BUTTON)); boolean continueAsGuestButtonSeen = false; if (continueAsGuest.size() > 0) { continueAsGuestButtonSeen = true; continueAsGuestButton.click();//from w ww . ja v a2s . c o m } LOGGER.info("Continue as guest button rendered: " + continueAsGuestButtonSeen); }
From source file:com.hotwire.selenium.desktop.us.billing.AbstractBillingPage.java
License:Open Source License
public void selectAsUser(String sEmail, String sPassword) { WebElement signIn = getWebDriver().findElement(By.xpath("//img[@alt='Sign in']")); if (signIn != null) { WebElement email = getWebDriver().findElement(By.name("loginForm._NAE_email")); WebElement password = getWebDriver().findElement(By.name("loginForm._NAE_password")); email.sendKeys(sEmail);/*from ww w. j a v a 2s . com*/ password.sendKeys(sPassword); signIn.click(); //...wait until Ajax is silent new Wait<>(new IsAjaxDone()).maxWait(15).apply(getWebDriver()); } }
From source file:com.hotwire.selenium.desktop.us.billing.air.AirCreditCardFragment.java
License:Open Source License
public AirCreditCardFragment withCcType(String creditCardType) { try {/*from w ww . j a va 2 s . com*/ if (getWebDriver().findElements(By.name("paymentForm.selectedCardType")).size() > 0) { new WebDriverWait(getWebDriver(), 5).until( ExpectedConditions.visibilityOfElementLocated(By.name("paymentForm.selectedCardType"))); new Select(getWebDriver().findElement(By.name("paymentForm.selectedCardType"))) .selectByVisibleText(creditCardType); } } catch (NoSuchElementException e) { LOGGER.info("Type of credit card is not available!"); } return this; }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.CarTravelerInfoFragment.java
License:Open Source License
public WebElement getOptionalSignInEmail() { return getOptionalSignInForm().findElement(By.name(nameOtionalSignInEmail)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.CarTravelerInfoFragment.java
License:Open Source License
public WebElement getOptionalSignInPassword() { return getOptionalSignInForm().findElement(By.name(nameOtionalSignInPassword)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.ccf.CcfPaymentMethodFragment.java
License:Open Source License
@Override public WebElement getPayPalState() { return getWebDriver().findElement(By.name(namePayPalState)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.ccf.CcfPaymentMethodFragment.java
License:Open Source License
@Override public WebElement getPayPalZip() { return getWebDriver().findElement(By.name(namePayPalZip)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.ccf.CcfPaymentMethodFragment.java
License:Open Source License
public WebElement getHotDollarsButton() { return getWebDriver().findElement(By.name(nameHotDollarsBtn)); }
From source file:com.hotwire.selenium.desktop.us.billing.car.impl.onepage.OpPurchaseReviewFragment.java
License:Open Source License
@Override public WebElement getAgreementCheckbox() { return getWebDriver().findElement(By.name(agreementCbx)); }
From source file:com.hotwire.selenium.desktop.us.billing.onepage.HotelTravelerInfoFragment.java
License:Open Source License
public void selectAddNewTravelerFromSelection() { new Select(travelerSavedNameSelect).selectByValue("-1"); new WebDriverWait(getWebDriver(), DEFAULT_WAIT) .until(PageObjectUtils.webElementVisibleTestFunction(By.name(FIRST_NAME), true)); new WebDriverWait(getWebDriver(), DEFAULT_WAIT) .until(PageObjectUtils.webElementVisibleTestFunction(By.name(LAST_NAME), true)); }