[英]can't run CHROME using selenium webdriver remote
I am using python with selenium webdriver to run and automate test cases on a grid. 我正在将python与selenium webdriver结合使用,以在网格上运行和自动化测试用例。 I am able start the FIREFOX browser with some warning messages on both hub and node, but it works fine. 我可以使用集线器和节点上的一些警告消息来启动FIREFOX浏览器,但工作正常。 But the issue is starting the same web application using CHROME. 但是问题是使用CHROME启动相同的Web应用程序。 I tried everything possible, but no help. 我尝试了所有可能的方法,但没有帮助。 Whenever I have to start off with the CHROME browser locally, I used to run the chromedriver.exe
to start the app. 每当我必须在本地使用CHROME浏览器启动时,我都会运行chromedriver.exe
来启动该应用程序。 but I don't know how to parse the chromedriver.exe
remotely to start the same app there. 但我不知道如何远程解析chromedriver.exe
以在那里启动相同的应用程序。 I have even tried installing and started running the chromedriver on the node and checked f it starts running but it was of no help.And have set the system property as well... 我什至尝试安装并开始在节点上运行chromedriver,并检查它是否开始运行,但这没有帮助。并且还设置了系统属性...
java -jar ./selenium-server-standalone-2.35.0.jar - Dwebdriver.chrome.driver='/opt/drivers/chromedriver' -role webdriver -hub http://192.168.1.10:4444/grid/register -port 5566 -browser browserName=chrome
output: 输出:
======================================================================
ERROR: test_search_in_python_org (__main__.PythonOrgSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python27\bharath.py", line 13, in setUp
self.driver = webdriver.Remote('http://192.168.1.62:4444/wd/hub',DesiredCapabilities.CHROME)
File "C:\Python27\lib\site-packages\selenium-2.47.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 87, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium-2.47.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 136, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python27\lib\site-packages\selenium-2.47.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 196, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium-2.47.1-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 181, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: The driver executable does not exist: C:\Users\user\'C:\Users\user\Desktop\chromedriver.exe'
Stacktrace:
at com.google.common.base.Preconditions.checkState (Preconditions.java:197)
at org.openqa.selenium.remote.service.DriverService.checkExecutable (DriverService.java:121)
at org.openqa.selenium.remote.service.DriverService.findExecutable (DriverService.java:116)
at org.openqa.selenium.chrome.ChromeDriverService.access$0 (ChromeDriverService.java:1)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable (ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build (DriverService.java:290)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService (ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init> (ChromeDriver.java:138)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance (Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor (DefaultDriverProvider.java:103)
at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance (DefaultDriverProvider.java:97)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance (DefaultDriverFactory.java:60)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call (DefaultSession.java:222)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call (DefaultSession.java:1)
at java.util.concurrent.FutureTask.run (FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run (DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
at java.lang.Thread.run (Thread.java:745)
----------------------------------------------------------------------
Ran 1 test in 1.310s
FAILED (errors=1)
Please help me out here... 请在这里帮我...
The issue seems that you're try to open the file pointing in the wrong location: 问题似乎是您尝试打开指向错误位置的文件:
WebDriverException: Message: The driver executable does not exist: C:\\Users\\user\\'C:\\Users\\user\\Desktop\\chromedriver.exe' Stacktrace:
btw isn't clear why you're trying to start chromedriver with java if you're using python.. btw尚不清楚,如果您使用的是python,为什么要尝试用Java启动chromedriver。
If you're using python you can check this: test suite python - webdriver 如果您使用的是python,则可以检查以下内容: 测试套件python-webdriver
Best Regards Claudio 最好的问候克劳迪奥
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.