-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow sending DevTools command with custom timeout. #15059
base: trunk
Are you sure you want to change the base?
Allow sending DevTools command with custom timeout. #15059
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
return sendWithTimeout(command, this.timeout); | ||
} | ||
|
||
public <X> X sendWithTimeout(Command<X> command, Duration timeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just name it send
.
@diemol do we need to add a test for this? |
I don't see the need for it. What do you think? |
After taking another look, I don't think so. I didn't realize sendWithTimeout() was just a wrapper for sendAndWait() |
Description
This PR is introducing an additional method (
DevTools#sendWithTimeout
) that allows consumers to send a DevTools command with a custom timeout instead of the hardcoded one.Motivation and Context
Some commands send oder CDP can take longer than the hardcoded timeout, e.g. printing a page to PDF. This might happen due to excessive work in the controller browser or during serialization/transmission. For cases like this,
DevTools#sendWithTimeout
can be used to use a higher timeout for these exceptional cases.Fixes #14912.
Types of changes
Checklist
PR Type
Enhancement
Description
Introduced
sendWithTimeout
method for custom timeout in DevTools commands.Refactored
send
method to utilizesendWithTimeout
internally.Improved flexibility for handling long-running DevTools commands.
Changes walkthrough 📝
DevTools.java
Add `sendWithTimeout` method for configurable timeouts
java/src/org/openqa/selenium/devtools/DevTools.java
sendWithTimeout
method for sending commands with a customtimeout.
send
method to delegate tosendWithTimeout
.sendWithTimeout
.