Internet Explorer WebDriver 不在机器人框架中启动
Internet Explorer WebDriver doesn't start in the robot framework
我 运行 在机器人框架中进行了一些测试,运行 适用于 firefox 和 chrome 但不适用于 Internet Explorer。我阅读了其他建议将安全级别设置为受保护的帖子,我也这样做了。
但随后出现以下错误:
WebDriverException: Message: Unexpected error launching Internet Explorer.
Mode must be set to the same value (enabled or disabled) for all zones.
webdriver.py-文件:
DEFAULT_TIMEOUT = 30
DEFAULT_PORT = 0
DEFAULT_HOST = None
DEFAULT_LOG_LEVEL = None
DEFAULT_LOG_FILE = None
class WebDriver(RemoteWebDriver):
def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
port=DEFAULT_PORT, timeout=DEFAULT_TIMEOUT, host=DEFAULT_HOST,
log_level=DEFAULT_LOG_LEVEL, log_file=DEFAULT_LOG_FILE):
self.port = port
if self.port == 0:
self.port = utils.free_port()
self.host = host
self.log_level = log_level
self.log_file = log_file
self.iedriver = Service(executable_path, port=self.port,
host=self.host, log_level=self.log_level, log_file=self.log_file)
self.iedriver.start()
if capabilities is None:
capabilities = DesiredCapabilities.INTERNETEXPLORER
RemoteWebDriver.__init__(
self,
command_executor='http://localhost:%d' % self.port,
desired_capabilities=capabilities)
self._is_remote = False
def quit(self):
RemoteWebDriver.quit(self)
self.iedriver.stop()
我是否也应该更改其他浏览器的安全级别?或者还有其他方法可以解决这个问题吗?提前致谢!
Not able to launch IE browser using Selenium2 (Webdriver) with Java
以上应该回答了您的问题,您不需要更改所有其他浏览器的安全级别。这不仅仅是启用保护模式这是你的问题,这是你对我想象的不同区域的安全级别不同,即 internet/intranet
我读到我需要 IgnoreProtectedModeSettings。
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.INTERNETEXPLORER
caps['ignoreProtectedModeSettings'] = True
driver = webdriver.Ie(capabilities=caps)
尝试将您的 URL 添加到 IE 浏览器的受信任站点中。这对我有用。我尝试了我找到的所有选项,但最终将 URL 添加到受信任的站点工作。确保添加正确的 URL(我的意思是 https/http,无论在 IE 中手动打开什么)。希望这有帮助。
请按照以下步骤操作,这可能会解决您的大部分问题。如果您的浏览器有代理设置,请从第 1 步开始,否则您可以从第 3 步开始
1.I 已在 IE 中启用代理。
2.Set environment variable no_proxy to 127.0.0.1 before launching the browser (i.. before starting the execution of testcase) Ex: Set Environmental Variable no_proxy 127.0.0.1
3.Set 所有相同级别(中到高)的 Internet 区域预计受限站点打开浏览器>工具>Internet 选项>安全选项卡
4.Enable "Enable Protected mode" 所有区域
我 运行 在机器人框架中进行了一些测试,运行 适用于 firefox 和 chrome 但不适用于 Internet Explorer。我阅读了其他建议将安全级别设置为受保护的帖子,我也这样做了。
但随后出现以下错误:
WebDriverException: Message: Unexpected error launching Internet Explorer.
Mode must be set to the same value (enabled or disabled) for all zones.
webdriver.py-文件:
DEFAULT_TIMEOUT = 30
DEFAULT_PORT = 0
DEFAULT_HOST = None
DEFAULT_LOG_LEVEL = None
DEFAULT_LOG_FILE = None
class WebDriver(RemoteWebDriver):
def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
port=DEFAULT_PORT, timeout=DEFAULT_TIMEOUT, host=DEFAULT_HOST,
log_level=DEFAULT_LOG_LEVEL, log_file=DEFAULT_LOG_FILE):
self.port = port
if self.port == 0:
self.port = utils.free_port()
self.host = host
self.log_level = log_level
self.log_file = log_file
self.iedriver = Service(executable_path, port=self.port,
host=self.host, log_level=self.log_level, log_file=self.log_file)
self.iedriver.start()
if capabilities is None:
capabilities = DesiredCapabilities.INTERNETEXPLORER
RemoteWebDriver.__init__(
self,
command_executor='http://localhost:%d' % self.port,
desired_capabilities=capabilities)
self._is_remote = False
def quit(self):
RemoteWebDriver.quit(self)
self.iedriver.stop()
我是否也应该更改其他浏览器的安全级别?或者还有其他方法可以解决这个问题吗?提前致谢!
Not able to launch IE browser using Selenium2 (Webdriver) with Java
以上应该回答了您的问题,您不需要更改所有其他浏览器的安全级别。这不仅仅是启用保护模式这是你的问题,这是你对我想象的不同区域的安全级别不同,即 internet/intranet
我读到我需要 IgnoreProtectedModeSettings。
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.INTERNETEXPLORER
caps['ignoreProtectedModeSettings'] = True
driver = webdriver.Ie(capabilities=caps)
尝试将您的 URL 添加到 IE 浏览器的受信任站点中。这对我有用。我尝试了我找到的所有选项,但最终将 URL 添加到受信任的站点工作。确保添加正确的 URL(我的意思是 https/http,无论在 IE 中手动打开什么)。希望这有帮助。
请按照以下步骤操作,这可能会解决您的大部分问题。如果您的浏览器有代理设置,请从第 1 步开始,否则您可以从第 3 步开始
1.I 已在 IE 中启用代理。
2.Set environment variable no_proxy to 127.0.0.1 before launching the browser (i.. before starting the execution of testcase) Ex: Set Environmental Variable no_proxy 127.0.0.1
3.Set 所有相同级别(中到高)的 Internet 区域预计受限站点打开浏览器>工具>Internet 选项>安全选项卡
4.Enable "Enable Protected mode" 所有区域