serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

How to run tests headlessly using Xvfb chrome or firefox? #183

Closed pushprajsingh05 closed 5 years ago

pushprajsingh05 commented 5 years ago

I want to run Serenity tests on Centos 7 non gui mode headlessly, but it is giving following error

net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate class org.openqa.selenium.firefox.FirefoxDriver at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:153) at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:140) at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:110) at net.thucydides.core.webdriver.WebDriverFacade.get(WebDriverFacade.java:181) at net.serenitybdd.core.pages.PageObject.openPageAtUrl(PageObject.java:860) at net.serenitybdd.core.pages.PageObject.open(PageObject.java:761) at net.serenitybdd.core.pages.PageObject.open(PageObject.java:749)

wakaleo commented 5 years ago

This is just Serenity relaying a WebDriver error, but there should be more details somewhere in the logs. Could be an incorrect version of geckodriver.

wakaleo commented 5 years ago

This is just Serenity relaying a WebDriver error, but there should be more details somewhere in the logs. Could be an incorrect version of geckodriver.

pushprajsingh05 commented 5 years ago

I have downloaded latest geckodriver. Copied it in project parallel to serenity.properties file. Now when I am running command mvn clean verify -Dwebdriver.driver=geckodriver. It is giving me below error: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

wakaleo commented 5 years ago

You need to set up a vritual display using something like xvnc or xvfb

pushprajsingh05 commented 5 years ago

I have xvfb installed already. It is only supporting geckodriver only or maybe something wrong in my configuration.

Now problem is if I quit putty session (remote access session) and login again. I have to first type:

export DISPLAY=:99

before I maven command mvn clean verify

pushprajsingh05 commented 5 years ago

I have to add it in .profile file. Closing this, thanks