github seleniumbase/SeleniumBase v1.59.1
Add the ability to set custom Chromium args. And more.

latest releases: v4.26.4, v4.26.3, v4.26.2...
3 years ago

Add the ability to set custom Chromium args. And update downloads.

  • Add custom Chromium args with: --chromium-arg="ARG,ARG".
    -- (As demonstrated, this can be a comma-separated list)
    -- If there's already a specific command-line option for the custom argument that you want to include, you should use the built-in option instead in order to maximize SeleniumBase compatibility. (See help_docs/customizing_test_runs.md and seleniumbase/plugins/pytest_plugin.py for examples of command-line args.) You can also type: sbase options on the command-line for a list of the most popular command-line options to use with SeleniumBase.

  • Have get_downloads_folder() return the ./downloaded_files/ path.
    -- Note: SeleniumBase has always set the custom downloads folder to be ./downloaded_files/ from the location where tests are launched, however, Chromium Guest Mode (non-headless) does not allow the changing of the default system downloads folder, which is where files go when a browser click initiates a file download. This can be an issue if using BOTH Guest Mode AND clicking to download files, because then those files won't be in SeleniumBase's isolated environment. The good news is that download_file(file_url) will still always use the custom ./downloaded_files/ folder because only browser click-initiated downloads are impacted (and only for headed Guest Mode, IE, and Safari tests). So get_downloads_folder() will point to the SeleniumBase custom path one, and get_browser_downloads_folder() will point to the location where click-initiated browser downloads go. For most browsers (non-guest Chrome, Edge, Firefox) those methods will return the same location (./downloaded_files/). However, Guest Mode Chrome, Safari, and IE (where the system downloads folder can't be changed) will have two download locations, based on how your test downloads the file. (See examples/test_download_files.py and examples/test_shadow_dom.py for example tests that download files.)
    When calling a method such as assert_downloaded_file(file), it will check the ./downloaded_files/ location by default, but there is a keyword option that you can add (browser=True) so that it looks in the system/browser-click-initiated downloads folder instead (which may be the same location): assert_downloaded_file(file, browser=True).

Don't miss a new SeleniumBase release

NewReleases is sending notifications on new releases.