本文整理匯總了Java中org.openqa.selenium.remote.RemoteWebDriver.findElementById方法的典型用法代碼示例。如果您正苦於以下問題:Java RemoteWebDriver.findElementById方法的具體用法?Java RemoteWebDriver.findElementById怎麽用?Java RemoteWebDriver.findElementById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openqa.selenium.remote.RemoteWebDriver
的用法示例。
在下文中一共展示了RemoteWebDriver.findElementById方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testShoppingCartAmounts
import org.openqa.selenium.remote.RemoteWebDriver; //導入方法依賴的package包/類
@Test
public void testShoppingCartAmounts() throws PaymentException {
Payment response = mpay24.paymentPage(getTestPaymentRequest(120.0, null), getTestShoppingCart());
assertSuccessfullResponse(response);
RemoteWebDriver driver = openFirefoxAtUrl(response.getRedirectLocation());
WebElement element = driver.findElementById("cart");
assertEquals("Rabatt:", element.findElement(By.xpath("tfoot/tr[1]/th")).getText());
assertEquals("-10,00", element.findElement(By.xpath("tfoot/tr[1]/td")).getText());
assertEquals("Versandkosten:", element.findElement(By.xpath("tfoot/tr[2]/th")).getText());
assertEquals("-5,00", element.findElement(By.xpath("tfoot/tr[2]/td")).getText());
assertEquals("Zwischensumme:", element.findElement(By.xpath("tfoot/tr[3]/th")).getText());
assertEquals("100,00", element.findElement(By.xpath("tfoot/tr[3]/td")).getText());
assertEquals("20.00% USt.:", element.findElement(By.xpath("tfoot/tr[4]/th")).getText());
assertEquals("20,00", element.findElement(By.xpath("tfoot/tr[4]/td")).getText());
assertEquals("Gesamtpreis:", element.findElement(By.xpath("tfoot/tr[5]/th")).getText());
assertEquals("EUR 120,00", element.findElement(By.xpath("tfoot/tr[5]/td")).getText());
}
示例2: testLanguageEnglish
import org.openqa.selenium.remote.RemoteWebDriver; //導入方法依賴的package包/類
@Test
public void testLanguageEnglish() throws PaymentException {
Payment response = mpay24.paymentPage(getTestPaymentRequest(1.0, null, Language.EN), getTestShoppingCart(getTestShoppingCartItemList()));
assertSuccessfullResponse(response);
RemoteWebDriver driver = openFirefoxAtUrl(response.getRedirectLocation());
WebElement element = driver.findElementById("cart");
assertEquals("No.", element.findElement(By.xpath("thead/tr[1]/th[1]")).getText());
assertEquals("Prod. No.", element.findElement(By.xpath("thead/tr[1]/th[2]")).getText());
assertEquals("Product Name", element.findElement(By.xpath("thead/tr[1]/th[3]")).getText());
assertEquals("Amount ordered", element.findElement(By.xpath("thead/tr[1]/th[4]")).getText());
assertEquals("Price/Item", element.findElement(By.xpath("thead/tr[1]/th[5]")).getText());
assertEquals("Total", element.findElement(By.xpath("thead/tr[1]/th[6]")).getText());
assertEquals("Discount:", element.findElement(By.xpath("tfoot/tr[1]/th")).getText());
assertEquals("Shipping Costs:", element.findElement(By.xpath("tfoot/tr[2]/th")).getText());
assertEquals("Subtotal:", element.findElement(By.xpath("tfoot/tr[3]/th")).getText());
assertEquals("Order Total:", element.findElement(By.xpath("tfoot/tr[5]/th")).getText());
}
示例3: testMostSimpleRedirectPayment
import org.openqa.selenium.remote.RemoteWebDriver; //導入方法依賴的package包/類
@Test
public void testMostSimpleRedirectPayment() throws PaymentException {
Payment response = mpay24.paymentPage(getTestPaymentRequest());
assertSuccessfullResponse(response);
RemoteWebDriver driver = openFirefoxAtUrl(response.getRedirectLocation());
WebElement element = driver.findElementById("CC");
assertNotNull(element.findElement(By.xpath("//input[@name='selCC|MASTERCARD']")));
assertNotNull(element.findElement(By.xpath("//input[@name='selCC|VISA']")));
}
示例4: testShoppingCartItems
import org.openqa.selenium.remote.RemoteWebDriver; //導入方法依賴的package包/類
@Test
public void testShoppingCartItems() throws PaymentException {
Payment response = mpay24.paymentPage(getTestPaymentRequest(120.0, null), getTestShoppingCart(getTestShoppingCartItemList()));
assertSuccessfullResponse(response);
RemoteWebDriver driver = openFirefoxAtUrl(response.getRedirectLocation());
WebElement element = driver.findElementById("cart");
assertEquals("Rabatt:", element.findElement(By.xpath("tfoot/tr[1]/th")).getText());
}