Import browser extensions in Safari/Edge/IE selenium

余生颓废 提交于 2019-12-06 00:45:04

I'm pretty sure none of those browsers have support for this in selenium. Your only option is to set up the browsers with extensions before running the tests. Safari and IE will probably never get support for this as the safari driver is deprecated and IE won't get any more updates as the focus will shift fully to Edge.

Microsoft Edge also does not even support extensions in the stable build yet at all.

Edge might get support in the driver once the feature has been rolled out to the stable release, as the Edge driver is created by Microsoft themselves.

Sources:

NOTE: The SafariDriver is deprecated. All code has been removed from master, but is still available in the safari branch

Personalize and add new features to Microsoft Edge with extensions. Starting with build 14291 for the Windows 10 Insider Preview, a selection of extensions is now available for Microsoft Edge.

Safari/IE/Edge doesn't have profile concepts and therefore whatever plugins/extensions and browser settings you have in your browser will be available when webdriver launches the browser.

For Safari you can use something like this:

'safari.cleansession': true,
'acceptSslCerts': true,
'safari.options': {
  'extensions': [{
    'contents': yourplugin,
    'filename': 'yourplugin.safariextz'
  }]
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!