Hi, I have a running instance of the Selenium Grid plugin running on Jenkins LTS 1.480.1. * I've configured the grid to use a chrome browser:
> {seleniumProtocol=WebDriver, platform=LINUX, browserName=chrome, > maxInstances=5, jenkins.nodeName=CentOS 6 Java 7, version=24.0} * I've installed the chromedriver on my remote machine at /usr/local/jenkins/tools/chrome/chromedriver * I've installed chrome on the remote machine at /usr/bin/google-chrome * I used the Firefox Selenium IDE to create a test case and tweaked it a bit for RemoteWebDriver import static org.junit.Assert.*; > > >> import java.net.URL; > > import java.util.concurrent.TimeUnit; > > import org.junit.After; > > import org.junit.Before; > > import org.junit.Test; > > import org.openqa.selenium.*; > > import org.openqa.selenium.chrome.ChromeDriver; > > import org.openqa.selenium.remote.DesiredCapabilities; > > import org.openqa.selenium.remote.RemoteWebDriver; > > >> public class ChromeTest { > > private WebDriver driver; > > private String baseUrl; > > private boolean acceptNextAlert = true; > > private StringBuffer verificationErrors = new StringBuffer(); > > DesiredCapabilities capability = DesiredCapabilities.chrome(); > > >> @Before > > public void setUp() throws Exception { > > System.setProperty("webdriver.chrome.driver", "/usr/local/jenkins/tools/chrome/chromedriver"); > capability.setBrowserName("chrome"); > > capability.setPlatform(Platform.LINUX); > > capability.setVersion("24.0"); > > driver = new RemoteWebDriver(new >> URL("http://jenkins.remote.machine:4444/wd/hub"), capability); > > baseUrl = "http://google.com"; > > driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); > > } > > >> @After > > public void tearDown() throws Exception { > > driver.quit(); > > String verificationErrorString = verificationErrors.toString(); > > if (!"".equals(verificationErrorString)) { > > fail(verificationErrorString); > > } > > } > > >> @Test > > public void testGoogle() { > > driver.get(baseUrl + "/"); > > } > > >> private boolean isElementPresent(By by) { > > try { > > driver.findElement(by); > > return true; > > } catch (NoSuchElementException e) { > > return false; > > } > > } > > >> private String closeAlertAndGetItsText() { > > try { > > Alert alert = driver.switchTo().alert(); > > if (acceptNextAlert) { > > alert.accept(); > > } else { > > alert.dismiss(); > > } > > return alert.getText(); > > } finally { > > acceptNextAlert = true; > > } > > } > > } > > I am getting the following error ------------------------------------------------------- T E S T S ------------------------------------------------------- parallel='classes', perCoreThreadCount=true, threadCount=2, > useUnlimitedThreads=false Running com.rp.selenium.rpsmoketest.ChromeTest log4j:WARN No appenders could be found for logger > (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager). log4j:WARN Please initialize the log4j system properly. Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.696 sec > <<< FAILURE! testGoogle(com.rp.selenium.rpsmoketest.ChromeTest) Time elapsed: 0.687 sec > <<< ERROR! org.openqa.selenium.WebDriverException: The path to the driver executable > must be set by the webdriver.chrome.driver system property; for more > information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The > latest version can be downloaded from > http://code.google.com/p/chromedriver/downloads/list Command duration or timeout: 243 milliseconds Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 > 15:53:30' System info: os.name: 'Linux', os.arch: 'amd64', os.version: > '2.6.32-279.19.1.el6.x86_64', java.version: '1.7.0_09' Driver info: org.openqa.selenium.remote.RemoteWebDriver at > com.google.common.base.Preconditions.checkState(Preconditions.java:176) at > org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105) at > org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:69) at > org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:131) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at > org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:57) at > org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:51) at > org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:196) at > org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1) at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at > org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:150) at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) > testGoogle(com.rp.selenium.rpsmoketest.ChromeTest) Time elapsed: 0.69 sec > <<< ERROR! java.lang.NullPointerException: null at > com.rp.selenium.rpsmoketest.ChromeTest.tearDown(ChromeTest.java:35) > > Results : > Tests in error: ChromeTest.setUp:28 » WebDriver The path to the driver executable must > be set ... ChromeTest.tearDown:35 NullPointer Specifically, I'm confused by the error. I've read the documents that the error mentions and I thought I was specifying the system property of webdriver.chrome.driver. Has anyone ran into this? Can anyone offer any help for my understanding of why I can't get chrome to work using the RemoteWebDriver and the Selenium Grid plugin? Thanks for looking, BH -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.