Firefox in ubuntu cli GLib-CRITICAL error -


i have installed firefox on ubuntu server can run selenium testing through jenkins linked bitbucket.

jenkins told me didnt have access firefox installed

sudo apt-get install firefox 

this installed firefox version 38. tests continued give errors this

org.openqa.selenium.firefox.notconnectedexception: unable connect 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 check version error comes to. have removed firefox , installed tar file version 35 since read fix problem.

it didn't fix it, error comes exact same version has been changed 35.

this main of script jenkins 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 text input element name           webelement element =  driver.findelement(by.name("q"));    // enter search           element.sendkeys("selenium testing tools cookbook");    // submit form. webdriver find              //the form element             element.submit();  system.out.println("you have logged  google6 website");  } //end of google search  @after    public void teardown() throws exception {        //close browser  driver.quit(); } }//end 

i don't believe script problem thought try build full picture.

any fixing firefox error appreciated. thanks

update 1

i using maven , version of selenium 2.45.0

update 2

i running firefox headlessly

your main problem is, not running x-server, firefox can't connect display. why

error: no display specified

which should main issue...

to solve need set xvfb or "real" x-server, depending on kind of server have , address exposed display of correctly (i.e. run selenium server process display=:1 if xvfb happens running on display :1).

this site helped me hold of issue time back. alternatively check out docker-selenium project selenium itself. if have means spin docker container on machine should quickest way around issue (if not, going through files provides understanding of how 1 can setup headless selenium environment on ubuntu machine)

wish luck issue , welcome cozy part of hell called headless testing ;)


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -