0

I am working with Serenity BDD and Selenium to automate my project's tests. These tests should be able to be run in both Windows and Ubuntu.

Now, I got the WebDriver's path set in my serenity.properties file:

#WebDriver for Google Chrome
#-------------------------------
webdriver.driver = chrome
webdriver.chrome.driver = C:\\chromedriver.exe

Obviously, webdriver.chrome.driver path only works if project is run in Windows. How can I make variable this path depending on OS?

Thanks in advance.

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
Miguel Ortega
  • 109
  • 1
  • 9
  • rename it to `webdriver.windows.chrome.driverlocation` and add another one called `webdriver.linux.chrome.driverlocation` then, in the startup of your tests you determine the os first and decide which property to work with depending on the os – Master Azazel Dec 30 '16 at 08:12
  • 1
    @MasterAzazel I did the next trick, but I don't know if it is a good practise. Serenity searches drivers by default in `/usr/bin`(Linux) or `C:\Windows\System32` (Windows). So, if you store the drivers in these folders, there is no need to especify any location. – Miguel Ortega Jan 03 '17 at 10:42
  • great - thats even better! – Master Azazel Jan 03 '17 at 15:10
  • @MasterAzazel Can you please tell me how I can determine the property to be used in the startup? Actually I am confused about where to write this code to initialize driver on the basis of OS. I am new to Serenity, and can't find many resources on the configuration of driver path on the basis of OS. – sameeksha sahib Apr 17 '20 at 07:11
  • i suggest you check the documentation. if that doesn't help create a new question with more details – Master Azazel Apr 17 '20 at 23:37

0 Answers0