我用FireFox编写了硒python测试。
当我尝试从与外壳程序不同的Linux用户运行测试时,出现此错误:
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details
OS:RHEL 6.5 FF:45.0 壁虎驱动程序:0.16.1 硒:3.141
class Test:
def setUp(self):
GeckoInit()
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = False
binary = FirefoxBinary("/pkgs/firefox/v45.0/firefox")
self.browser = Browser(binary, firefox_capabilities)
class Browser(Firefox):
def __init__(self, binary, desired_capabilities):
super(Browser, self).__init__(firefox_binary=binary, desired_capabilities=desired_capabilities)