Fix CDP download for custom browsers#2728
Merged
asolntsev merged 1 commit intoselenide:mainfrom Apr 28, 2024
Merged
Conversation
9161041 to
43364d0
Compare
asolntsev
requested changes
Apr 25, 2024
| import org.openqa.selenium.WebDriver; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
Member
There was a problem hiding this comment.
@PetroOv Please avoid massive changing order of imports. Let them rest in peace.
| Configuration.remote = gridUrl.toString(); | ||
| Configuration.browserCapabilities.setCapability("se:downloadsEnabled", true); | ||
| Configuration.fileDownload = CDP; | ||
| closeWebDriver(); |
Member
There was a problem hiding this comment.
it will slow down all previous tests.
Let's close the browser only in one test.
| } | ||
| Optional<HasDevTools> cdpBrowser = cast(driver.getWebDriver(), HasDevTools.class); | ||
| if (cdpBrowser.isPresent()) { | ||
| DevTools devTools = cdpBrowser.get().getDevTools(); |
Member
There was a problem hiding this comment.
The problem is that Firefox doesn't support downloading files via CDP.
We need to exclude Firefox in this IF. @PetroOv
Contributor
Author
There was a problem hiding this comment.
I didn't know it( I returned isChromium check, but now we get browser name from capabilities of instance
43364d0 to
2af8482
Compare
|
asolntsev
added a commit
that referenced
this pull request
Apr 28, 2024
PetroOv
pushed a commit
to PetroOv/selenide
that referenced
this pull request
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Proposed changes
This PR fixes IllegalArgumentException for custom DriverProvider/DriverFactory when they support cdp
Checklist
gradlew check chrome_headless firefox_headlesscommand