OS: Windows10
Selenium Version: 3.8.1
Browser: IE11
When I try to run python-selenium on IE11, I got an exception below
selenium.common.exceptions.SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100%
I have set IE capabilities like below
def ie_driver(self):
ie_driver = r'C:\Users\ZiYingSu\Documents\python\IEDriverServer.exe'
os.environ['webdriver.ie.driver'] = ie_driver
cap = DesiredCapabilities.INTERNETEXPLORER
cap['platform'] = 'WINDOWS'
cap['browserName'] = 'internet explorer'
cap['ignoreProtectedModeSettings'] = True
**cap['ignoreZoomSetting'] = True**
cap['IntroduceInstabilityByIgnoringProtectedModeSettings'] = True
cap['requireWindowFocus'] = True
cap['INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS'] = True
self.driver = webdriver.Ie(ie_driver ,capabilities=cap)
return self.driver
I don't get it why this capability['ignoreZoomSetting'] doesn't work ? I don't want to adjust my IE by manually everytime
Thanks
Browser Version: IE11(64-bit)
IE can ignore zoom setting
Got exception on selenium
selenium.common.exceptions.SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100%
It doesn't look to me like you are putting the option in the correct spot. That is an IE option, and needs to be in the se:ieOptions key within capabilities. I don't see how any of those options are taking without being in the right spot.
Try this code instead:
from selenium.webdriver.ie.options import Options
def ie_driver(self):
ie_driver = r'C:\Users\ZiYingSu\Documents\python\IEDriverServer.exe'
opts = Options()
opts.ignore_protected_mode_settings = True
opts.ignore_zoom_level = True
opts.require_window_focus = True
self.driver = webdriver.Ie(ie_driver, ie_options=opts)
return self.driver
Closing as there has been no response from issue creator
Most helpful comment
It doesn't look to me like you are putting the option in the correct spot. That is an IE option, and needs to be in the
se:ieOptionskey within capabilities. I don't see how any of those options are taking without being in the right spot.Try this code instead: