本文整理汇总了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());
}