Reputation: 153
I am trying to save a zip file by using download as option inside a specific folder. I found a way by which I am able to download the file. But the problem where I am stuck is while setting default path in ubuntu it is taking frontslash /
, whereas in windows it takes backslash \
.
Below is my code which i am using to set the default path.
HashMap<String, Object> hashmap = new HashMap<>();
String defaultPath = System.getProperty("user.dir")+ "\\src\\main\\resources";
hashmap.put("download.default_directory", defaultPath);
options.setExperimentalOption("prefs", hashmap);
During execution the default path is set as below in Ubuntu 20.04 which causing the test case to fail as the file is downloaded in the default location.
/home/user/git/ui-automation\src\main\resources
Can someone help me to resolve this issue ?
Upvotes: 0
Views: 119