0

I want to provide a relative path in serenity.properties file. So that my project is OS independent.

When I am trying:

chrome_preferences.download.default_directory = /target

it is failing, means chrome's default directory doesn't change but when I give full path like this

chrome_preferences.download.default_directory = D:\\automation-practice-tests\\target

it works perfectly fine, but if I choose to use absolute path it will not remain OS independent.

How can I fix it?

paul
  • 4,333
  • 16
  • 71
  • 144
  • What happens if you specify just `target`? A leading `/` normally indicates the root of the filesystem. – SiKing Aug 30 '19 at 21:51
  • It doesn't take `target`. It keeps on download file in chromes default directory i.e. Downloads folder. Does specifying only `target` worked for you? – paul Sep 02 '19 at 08:00

2 Answers2

1

I know is a little late, but this is how I resolved the problem:

chrome_preferences.download.default_directory=${user.dir}\\src\\test\\resources\\files\\downloads

In your case

chrome_preferences.download.default_directory = ${user.dir}\\target
0

This worked in my Mac and I am able to download the file

chrome.preferences.download.default_directory="${user.dir}\\target"
chrome.preferences.profile.default_content_settings.popupsy=0
chrome_preferences.pdfjs.disabled=true
KingArasan
  • 733
  • 1
  • 10
  • 19