1
votes

I first started with the latest IEDriverSErver.exe v3.5.0 with enabled protected mode enabled for all the security zones and the registry FEATURE_BFCACHE subkey DWord value to 0.

I would run the following code

from selenium import webdriver driver = webdriver.Ie()

And get an Error

 Message: Invalid capabilities in alwaysMatch: unknown capability named platform.

Next I tried to use IEDriverServer.exe v3.4.0 with the same settings and get the a different error, but the IE11 browser would open, but I can't control it due to error

Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070005 ('Access is denied.') for URL 'http://localhost:56039/'

I am pretty new at python and having regained the fun with coding again. I used to avoid programming in the past, but with a new outlook started to tackle python again and enjoying it. Now for the question:

I am trying to get python selenium module to open a Internet Explorer 11 browser but seem to having a bit of trouble.

If anyone has any tip, tricks, help, or pointers, it would be greatly appreciated.

Thanks,

Learning Python Programmer Python 3.5.0 Selenium 3.5.0 Internet Explorer 11 Version 11.0.9600.1872CO IEDriver 3.5.0 and 3.4.0

2

2 Answers

0
votes

While working with Selenium 3.5.0, IEDriverServer 3.5.0 and IE 11 you can consider to adapt to the configuration mentioned in this documentation and try the following code block:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

capabilities = DesiredCapabilities.INTERNETEXPLORER
capabilities["platform"] = "WIN8"
capabilities["browserName"] = "internet explorer"
capabilities["ignoreProtectedModeSettings"] = True
capabilities["IntroduceInstabilityByIgnoringProtectedModeSettings"] = True
capabilities["nativeEvents"] = True
capabilities["ignoreZoomSetting"] = True
capabilities["requireWindowFocus"] = True
capabilities["INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS"] = True

browser = webdriver.Ie(capabilities=capabilities, executable_path="C:\\Utility\\BrowserDrivers\\IEDriverServer.exe")
browser.get("https://www.facebook.com/")
0
votes

Possible workaround for the unknown capability named platform issue can be found here.

Basically you delete platform and version keys from the capabilities.