简体   繁体   中英

When running selenium script through jenkins on linux machine firefox is not getting launch

i am setting up to the jenkins (hudson) on linux environment .to run my selenium script .

So i configure a job in jenkins from which i am fetching code from svn and then i am starting selenium server and then invoking ant to run my scripts. but when i am running this job my selenium server get started inline but firefox is not getting launched. So i checked on the google they were saying to use Xvfb. I have installed Xvfb on Linux machine and download a xvfb plugin in jenkins And set up its configuration on Jenkins still my firefox is not getting launched.

could you please help me how we use to configure Xvfb in jenkins and How this firefox launch problem can be resolved

You didn't specify the language, but for python, you'll need to import the package pyvirtualdisplay .

from pyvirtualdisplay import Display

display = Display(visible=0, size=(800, 600))
display.start()

Then run your webdriver code:

browser = webdriver.Firefox()
browser.get('http://www.foo.com')
<< etc. >>

Great succinct write-up here: http://coreygoldberg.blogspot.co.uk/2011/06/python-headless-selenium-webdriver.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM