【发布时间】:2011-09-16 15:25:25
【问题描述】:
我正在尝试使用 Chrome Drive 执行我的一些测试,这些测试与 Firefox 完美配合,但我无法执行它们,我已经验证了要求,即 Chrome 的位置, 12 或更高版本之类的,但无论如何仍然无法正常工作,调用驱动程序的方法是:
WebDriver fd = new ChromeDriver();
fd.get("url");
然后搜索一些元素,但没有任何效果,错误消息是:
线程“main”中的异常 org.openqa.selenium.WebDriverException: 找不到 Chrome。放 webdriver.chrome.bin 系统信息: os.name: 'Windows XP', os.arch: 'x86', os.version:'5.1',java.version: '1.6.0_18' 驱动程序信息: driver.version:ChromeDriver 在 org.openqa.selenium.chrome.ChromeBinary.getChromeBinaryLocation(ChromeBinary.java:220) 在 org.openqa.selenium.chrome.ChromeBinary.getCommandline(ChromeBinary.java:121) 在 org.openqa.selenium.chrome.ChromeBinary.prepareProcess(ChromeBinary.java:67) 在 org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:109) 在 org.openqa.selenium.chrome.ChromeCommandExecutor.start(ChromeCommandExecutor.java:373) 在 org.openqa.selenium.chrome.ChromeDriver.startClient(ChromeDriver.java:65) 在 org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:85) 在 org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:25) 在 org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:43) 在 org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:53) 在 equifax.qa.test.NewTests.access.main(access.java:11)
如果有人可以帮助我,那就太好了。
【问题讨论】:
-
此堆栈跟踪来自旧版本的 Selenium,在 ChromeDriver 重写之前。显示的某些类不再存在。下面给出的建议假设您使用的是较新版本。
-
你知道如何从 Python 中做到这一点吗?当我使用 Firefox 时,我会执行以下操作:如果有用于 chrome 的 python 模块? from selenium import selenium import unittest, time, re class Untitled(unittest.TestCase): def setUp(self): self.verificationErrors = [] self.selenium = selenium("localhost", 4444, "*chrome", "@987654321 @) self.selenium.start()
-
解决了我上面的问题。我可以用 *firefox、*mock、*firefoxproxy、*pifirefox、*chrome、*iexploreproxy、*iexplore、*firefox3、*safariproxy、*googlechrome、*konqueror、*firefox2、*safari、*piiexplore 替换“*chrome” *firefoxchrome, *opera, *iehta, *custom
-
我正在使用 groovy?如何为 groovy 提供这个?
-
我也有同样的问题,实际上我在这里发布了我的问题stackoverflow.com/questions/18436156/… 我很困惑...是 Selenium、chromedriver 的问题还是什么?
标签: java testing selenium webdriver