You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using the SerenityParameterizedRunner for data-driven tests. In each test, I am looking for a way to:
create a folder (that is unique to each set of data)
download files into this folder.
repeat Step 1 & 2 for each set of data
Setting the download directory is relatively straightfoward: chromePrefs.put("download.default_directory", "path\to\file" + UUID.randomUUID().toString());
However as the webdriver initialization only happens once, all files for all tests are still downloaded to the same folder.
Trying to workaround this issue, I then tried using the @Managed annotation: @Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.BeforeEachTest) public WebDriver hisBrowser;
However this doesn't seem to work. I'm guessing that somehow it is not initializing a new browser instance for each dataset...
Can I get some advice on dynamically specifying download folders at runtime, for SerenityParameterizedRunner please?
The text was updated successfully, but these errors were encountered:
timothyjmtan
changed the title
Unique browser session with SerenityParameterizedRunner.class
Dynamically defining download directory at runtime with SerenityParameterizedRunner.class
Jun 13, 2018
download.default_directory is only taking absolute path if I am setting 'chrome_preferences.download.default_directory'. But It unable to download the file if value set relative to project root path.
Do you face same issue or any help will be appreciated.
I am currently using the SerenityParameterizedRunner for data-driven tests. In each test, I am looking for a way to:
Setting the download directory is relatively straightfoward:
chromePrefs.put("download.default_directory", "path\to\file" + UUID.randomUUID().toString());
However as the webdriver initialization only happens once, all files for all tests are still downloaded to the same folder.
Trying to workaround this issue, I then tried using the @Managed annotation:
@Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.BeforeEachTest)
public WebDriver hisBrowser;
However this doesn't seem to work. I'm guessing that somehow it is not initializing a new browser instance for each dataset...
Can I get some advice on dynamically specifying download folders at runtime, for SerenityParameterizedRunner please?
The text was updated successfully, but these errors were encountered: