禁用Internet Explorer的远程WebDriver的本机事件

时间:2017-07-14 18:24:45

标签: python selenium internet-explorer selenium-webdriver remotewebdriver

如何禁用Python Selenium Remote Webdriver和Internet Explorer的本机事件?

也许相关:我特意尝试使用BrowserStack的Internet Explorer 9,10进行自动化测试。

目前我正在构建我的远程webdriver:

import webdriver

url = "https://%(username)s:%(automate_key)s@hub-cloud.browserstack.com/wd/hub" % {
   'username': 'foo',
   'automate_key': 'fookey'
}
capabilities = webdriver.DesiredCapabilities.INTERNETEXPLORER.copy()
capabilities['platform'] = "WINDOWS"
capabilities['version'] = "9"  # IE9
driver = webdriver.Remote(url, desired_capabilities=capabilities)

1 个答案:

答案 0 :(得分:2)

未经测试,但我相信您正在寻找capabilities['nativeEvents'] = False 功能:

Client

参考:

https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities