与 assertconfirmation 等效的Webdriver是什么?我有以下 selenium IDE 代码,当导出到 JUnit 4 (Webdriver) 时返回错误:
IDE代码:
<tr>
<td>click</td>
<td>link=Logout</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you sure you want to logout?</td>
<td></td>
</tr>
导出的 Webdriver 代码对应于上述:
@Test
public void testUntitled2() throws Exception {
driver.findElement(By.linkText("Logout")).click();
// ERROR: Caught exception [ERROR: Unsupported command [getConfirmation]]
}
我曾经能够成功地将以下内容与 RC 一起使用,但使用 webdriver 它不再起作用 - (请注意我正在尝试将我的脚本迁移到 webdriver)
assertTrue(selenium.getConfirmation().matches("^Are you sure you want to logout[\\s\\S]$"));
干杯
山