我正在尝试使用WebDriver来自动化网站.
我正在使用Firefox驱动程序,但主页有一个弹出模式警报窗口:说:
You need to use IE 6.0 for viewing this application. Else some
features may not work
I checked the Source of the page, it has a function.
The Modal Alert is not an HTML element, I tried finding any element with FireBug, but to no avail.
if ( strBrowName == "Microsoft Internet Explorer" )
{
if ( (( strBrowVersion.indexOf( 'MSIE 6' ) ) > 0 ) )
{
}
else
{
alert( "You need to use IE 6.0 for viewing this application. Else some features may not work" );
}
在我的WebDriver代码中,我在驱动程序中使用了以下功能(如其他帖子所示)
DesiredCapabilities dc=new DesiredCapabilities();
dc.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,UnexpectedAlertBehaviour.ACCEPT);
WebDriver driver =new Fire