serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
721 stars 517 forks source link

Cannot run chrome driver on ubuntu 16.04 #1037

Closed fedika closed 6 years ago

fedika commented 6 years ago

Dear Serenity,

Currently, I have setup Jenkins on Ubuntu 16.04, then I also have made job to run Serenity BDD. But I have a problem which not happened on my local notebook (Windows), this Serenity BDD run properly on my local notebook. The problem is the driver is not executable on Ubuntu 16.04. I downloaded chromedriver for linux64 from here. I also have tried with chromedriver for linux 32bit and 64bit, but none of them works...

This is error log:

[pool-1-thread-1] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Open EC site [pool-1-thread-1] ERROR net.serenitybdd.core.Serenity - Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (The driver is not executable: /var/lib/jenkins/workspace/STG-MobileWeb-SerenityCucumber/chromedriver

Here is my POM.xml

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <serenity.version>1.5.7</serenity.version>
        <serenity.maven.version>1.5.7</serenity.maven.version>
        <serenity.cucumber.version>1.5.4</serenity.cucumber.version>
        <serenity.report.resources.version>1.5.3</serenity.report.resources.version>
        <serenity.cucumber.archetype.version>1.2.0</serenity.cucumber.archetype.version>
        <serenity.junit.archetype.version>1.2.0</serenity.junit.archetype.version>
        <parallel.tests>6</parallel.tests>
        <webdriver.driver>chrome</webdriver.driver>
        <encoding>UTF-8</encoding>
        <allure.cucumber.jvm.adaptor.version>1.6.4</allure.cucumber.jvm.adaptor.version>
        <aspectj.version>1.8.4</aspectj.version>
    </properties>

This is my serenity.properties (placed in the root of my project directory, same location as pom file):

webdriver.driver = chrome
webdriver.chrome.driver = chromedriver

serenity.project.name = Automated Testing Mobile Web

chrome.switches = --headless;--incognito;--disable-download-notification;--user-agent=Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36;--enable-automation

firefox.preferences=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
firefox.preference.separator=&

serenity.use.unique.browser = false

serenity.browser.height = 736
serenity.browser.width = 414
serenity.dry.run=false

serenity.test.root=net.thucydides.showcase.cucumber.junit

# How long does Serenity wait for elements that are not present on the screen to load (in miliseconds)
webdriver.timeouts.implicitlywait = 20000

#serenity.take.screenshots=FOR_FAILURES
#serenity.take.screenshots=FOR_EACH_ACTION
serenity.take.screenshots=BEFORE_AND_AFTER_EACH_STEP
#serenity.take.screenshots=AFTER_EACH_STEP
#serenity.take.screenshots=DISABLED

#serenity.batch.strategy=DIVIDE_EQUALLY
#serenity.batch.number=1
#serenity.batch.size=2

Does anyone ever faced this problem?

Thank you :)

wakaleo commented 6 years ago

Can you run chromedriver from the command line on the Jenkins box? Is it on the path? A simple process to do this is: 1) Copy the chromedriver binary to /usr/local/bin 2) Make it executable:

chmod +x /path/to/chromedriver
wakaleo commented 6 years ago

By the way, http://serenity-bdd.rocket.chat is a better forum for this kind of question.

wakaleo commented 6 years ago

Closing - please add any additional questions on the Chat channel