单击.net中的确认对话框Selenium



我正在尝试使Selenium 2.4.0接受Javascript生成的"Confirm-Dialog",使用Specflow和Firefox。我找不到下一步该怎么做。(试图从各种Java实现中找到。net中的等效方法,但它不起作用)

When I click "Delete" on the App
    And I confirm the warning

步骤定义……

[When(@"I confirm the warning")]
public void WhenIConfirmTheWarning()
{
    // WebDriver.Something?
}

在.NET绑定中确认警报的方法如下:

driver.SwitchTo().Alert().Accept();

我已经使用Selenium . net绑定2.4.0,使用Firefox 5.0。

您使用的是Firefox 4吗?X或以上?Firefox 4似乎有个问题。Selenium 2.0b3中的Firefox 4确认对话框建议的解决方案是迁移到Selenium/WebDriver。

最新更新