WebDriverManager integration with jenkins

798 Views Asked by At

I am having issues in running WebDriverManager in Jenkins this is my code:

                WebDriverManager.firefoxdriver().setup();
                FirefoxOptions firefoxOptions = (FirefoxOptions) options;
                return new FirefoxDriver(firefoxOptions);

locally it works perfectly but on jenkins I am getting this error:

org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX

Any idea what can I do in order to solve this?

Thanks

1

There are 1 best solutions below

0
On

Install Firefox on Jenkins. If it is a headless environment, you will also need to install Xvfb (X virtual framebuffer) and set a DISPLAY environmental variable. More info for instance here.