I'm guessing the problem is that there is no display available for Firefox or Chrome to use. I'd suggest using the XVFB plugin to create a virtual frame buffer which can be used to create a display for Firefox & Chrome to attach too.
Richard. On Wed, Dec 4, 2013 at 10:45 PM, Paridhi Mittal < [email protected]> wrote: > Hello > > I am running my selenium webdriver test cases on jenkins using firefox and > chromedriver. I am using chromedriver of version 31.0.1650.57 > Firefox of versio 25.0 and selenium webdriver version 2.37.0 , > httpclient 4.1.1 And jenkins version 1.541. > Test cases are unsuccessful on firefox its giving error unable to connect > to usr/bin/firefox on port 7055 and chrome its chrome failed to start > exited abnormally. > My sample test case is > package com.thecharmworks.selenium; > > import static org.junit.Assert.*; > import java.io.File; > import java.io.FileInputStream; > import java.io.InputStream; > import java.security.CodeSource; > import java.util.Properties; > import org.junit.Test; > import org.openqa.selenium.By; > import org.openqa.selenium.WebDriver; > import org.openqa.selenium.chrome.ChromeDriver; > import org.openqa.selenium.firefox.FirefoxDriver; > import org.openqa.selenium.firefox.FirefoxProfile; > import org.openqa.selenium.firefox.internal.ProfilesIni; > > public class TestBase { > private WebDriver driver; > @Test > public void FirfoxUp() throws Exception { > ProfilesIni profile = new ProfilesIni(); > FirefoxProfile myprofile = profile.getProfile("default"); > driver = new FirefoxDriver(myprofile); > testUntitled(); > } > @Test > public void CRconfiguration() throws Exception{ > CodeSource codeSorce = > TestBase.class.getProtectionDomain().getCodeSource(); > File file = new File(codeSorce.getLocation().toURI().getPath()); > String path = file.getParentFile().getParent(); > Properties property = new Properties(); > String propertyFilePath = file.getParentFile().getParent() + > File.separator +"config" + File.separator + > "GoldenCharmTestCases.properties"; > InputStream inputStream = new FileInputStream(propertyFilePath); > property.load(inputStream); > String webDriverPath = property.getProperty("webdriver.chrome"); > webDriverPath = path.concat(webDriverPath); > System.setProperty("webdriver.chrome.driver", webDriverPath); > driver = new ChromeDriver(); > testUntitled(); > } > > public void testUntitled() throws Exception { > driver.get("http://www.google.com/"); > System.out.println("hello jenkins"); > } > > } > > > > Not getting were I am getting wrong. Can anyone help to trace it and > guide me. > > > Regards > Paridhi Mittal > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
