当前位置: 首页>>代码示例>>Java>>正文


Java RemoteWebDriver.findElementById方法代码示例

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

}
 
开发者ID:mpay24,项目名称:mpay24-java,代码行数:23,代码来源:TestPaymentPanel.java

示例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());
}
 
开发者ID:mpay24,项目名称:mpay24-java,代码行数:19,代码来源:TestPaymentPanel.java

示例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']")));
}
 
开发者ID:mpay24,项目名称:mpay24-java,代码行数:10,代码来源:TestPaymentPanel.java

示例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());
}
 
开发者ID:mpay24,项目名称:mpay24-java,代码行数:10,代码来源:TestPaymentPanel.java


注:本文中的org.openqa.selenium.remote.RemoteWebDriver.findElementById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。