Selenium 2.5 无法在 Android 上使用 driver.get
我在 iOS 上一切运行良好,并且正在尝试启动并运行 Android Web 测试。我正在用 Python 2.7.2 编写测试。
当我尝试以下代码时出现异常:
from selenium import webdriver
driver = webdriver.Remote(desired_capabilities="ANDROID", command_executor='http://localhost:8080/wd/hub')
driver.get('http://www.google.com')
我在 driver.get 命令中遇到异常。但同样的命令也适用于 iOS。 Android 有不同的实现吗?
例外:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 154, in get
self.execute(Command.GET, {'url': url})
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 144, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 118, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: None ; Stacktrace: Method handle threw an error in WebDriverHandler.java
I have everything running well on iOS, and am trying to get up and running with Android web testing. I am writing the tests in Python 2.7.2.
I get an exception when I try the below code:
from selenium import webdriver
driver = webdriver.Remote(desired_capabilities="ANDROID", command_executor='http://localhost:8080/wd/hub')
driver.get('http://www.google.com')
I get an exception with the driver.get command. But the same command works on iOS. Is there a different implementation for Android?
Exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 154, in get
self.execute(Command.GET, {'url': url})
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 144, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-2.5.0-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 118, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: None ; Stacktrace: Method handle threw an error in WebDriverHandler.java
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论