I have installed Firefox on my ubuntu server so I can run selenium testing through jenkins linked to bitbucket.
Jenkins told me that it didnt have access to firefox so I installed it with
sudo apt-get install firefox
this installed firefox version 38. the tests continued to give errors like this
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
(process:28482): GLib-CRITICAL **: g_slice_set_config: assertion
'sys_page_size == 0' failed
Error: no display specified
(process:28489): GLib-CRITICAL **: g_slice_set_config: assertion
'sys_page_size == 0' failed
Error: no display specified
when I check the version this error comes up to. I have fully removed firefox and installed from the tar file to version 35 since I read that this could fix the problem.
It didn't fix it, the error comes back the exact same but the version has been changed to 35.
This is the Main of script that Jenkins is running
public class Test {
protected WebDriver driver;
@Before
public void setUp(){
driver = new FirefoxDriver();
driver.get("http://www.google.com");
} //End Before
@Test
public void testGoogleSearch() {
// Find the text input element by its name
WebElement element = driver.findElement(By.name("q"));
// Enter something to search for
element.sendKeys("Selenium testing tools cookbook");
// Now submit the form. WebDriver will find
//the form for us from the element
element.submit();
System.out.println("You have just logged into the google6 website");
} //End of google search
@After
public void tearDown() throws Exception {
//Close the browser
driver.quit();
}
}//end
I don't believe the script is the problem but I thought that I would try to build a full picture.
Any help fixing this firefox error is really appreciated. Thanks
Aucun commentaire:
Enregistrer un commentaire