Gecko driver and Chrome driver location

310 views
Skip to first unread message

Srinivas Aditya

unread,
Jun 20, 2018, 12:55:01 AM6/20/18
to Serenity BDD Users Group
Hi

I would request for help on where to place the firefox gecko and chromedriver.exe in my Serenity framework. 

Within my framework's user.dir folder, I created a folder called lib and copied the geckodriver.exe and chromedriver.exe into the lib folder. Is this going to work?

I was reading a post written by Serenity BDD expert who suggest placing them on System path as placing them in the project's user.dir reduces portability of the project. 
I don't understand why placing them in user.dir and having them as part of the project reduces portability. Kindly clarify.

I assume System Path mean Windows Path environment variable. Is it correct?

Regards
Srinivas


ankit garg

unread,
Jun 20, 2018, 1:50:58 AM6/20/18
to Srinivas Aditya, Serenity BDD Users Group
You can have  them anywhere just add the path in serenity.properties file something like below:

webdriver.chrome.driver=C:\\Softwares\\chromedriver_win32\\chromedriver.exe

Hope it will help!!

Regards,
Ankit

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
Visit this group at https://groups.google.com/group/thucydides-users.
For more options, visit https://groups.google.com/d/optout.

John Smart

unread,
Jun 20, 2018, 2:11:18 AM6/20/18
to ankit garg, Srinivas Aditya, Serenity BDD Users Group
If the binaries are in your local directory, the tests will only run on your machine.

A more robust approach is to have your drivers in your source code, but have different drivers per OS. For example, in the serenities.properties file, put:

drivers.windows.webdriver.chrome.driver = src/test/resources/webdriver/windows/chromedriver.exe
drivers.mac.webdriver.chrome.driver = src/test/resources/webdriver/mac/chromedriver
drivers.linux.webdriver.chrome.driver = src/test/resources/webdriver/linux/chromedriver

Or in the serenity.conf file, put:

    drivers {
      windows {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/windows/chromedriver.exe"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/windows/geckodriver.exe"
      }
      mac {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/mac/chromedriver"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/mac/geckodriver"
      }
      linux {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/linux/chromedriver"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/linux/geckodriver"
      }
    }
--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.

Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here.
___________________________________________________

ankit garg

unread,
Jun 20, 2018, 2:19:30 AM6/20/18
to John Smart, Srinivas Aditya, Serenity BDD Users Group
I tried above second approach of putting the paths  in the serenity.conf file, 

    drivers {
      windows {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/windows/chromedriver.exe"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/windows/geckodriver.exe"
      }
      mac {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/mac/chromedriver"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/mac/geckodriver"
      }
      linux {
        "webdriver.chrome.driver" = "src/test/resources/webdriver/linux/chromedriver"
        "webdriver.gecko.driver" = "src/test/resources/webdriver/linux/geckodriver"
      }
    }

I have updated the paths in above.However I am getting below error message:

Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (The path to the chromedriver driver executable must be set by the webdriver.chrome.driver system property; 


John Smart

unread,
Jun 20, 2018, 2:37:36 AM6/20/18
to ankit garg, Serenity BDD Users Group, Srinivas Aditya
Are the files in those directories? Are you using the latest version of Serenoty?

To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.

Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here.
___________________________________________________
Reply all
Reply to author
Forward
0 new messages