-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[馃悰 Bug]: Slow responses to driver commands #14198
Comments
@MJB222398, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
We lost 1 second here:
Writing this "big" message to the disk takes time. And then actual http request took 1 second as well:
You already proposed an optimization, and now we are logging request in parallel. In this particular example in saves 1 second, much better. Another optimization we may consider is to truncate "big" http requests when logging it. It should improve logging. Or write to the disk as a queue. If we choose writing as a queue then we even don't need to truncate log messages. When above approaches are implemented we see that total duration of command executing is still ~1sec. My thoughts:
|
For clarity the actions being performed in the logs above are:
So I think that big script is what Selenium is using when we use the 'Displayed' property? So not some custom action. This property must be used a lot, maybe it makes sense for that to be really well optimised by Selenium itself out of the box like you suggested by pinning it somewhere? |
First, Java has a toggle for this:
And I added th name of the script is to the beginning if you truncate it'll still show up. The isDisplayed script used to be implemented by the drivers and accessed by a simple endpoint, but it couldn't be specified by w3c, so the endpoint wasn't guaranteed, so we started sending the full script. The fix is for us to preload it in browser contexts with webdriver bidi once we start implementing that spec (Selenium 5?) In the meantime, I personally no longer check for displayedness in my code. I locate & click and rescue/retry loop a not found exception. "Exception by flow control" is "bad" but it improves performance considerably when 98% of the time the element is displayed and you are just wasting a large command. |
What happened?
I am seeing tests fail to pick out toasts in my application. These toasts hang around for 4 seconds and I perform a few driver commands to get what I need from them. In most cases this works perfectly fine. In a few cases (1% or less) however the response times for the commands I execute are very slow (> 1s) and so the toast can disappear before I have all I need from it.
I am wondering if there is an issue somewhere that is causing the slow responses. Is there anything that can be done about it?
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu 20..04
Selenium version
4.21.0
What are the browser(s) and version(s) where you see this issue?
Chrome, Edge, and Firefox. Here this example is Firefox 126.0
What are the browser driver(s) and version(s) where you see this issue?
Chrome, Edge, and Firefox. Here this example is Firefox 126.0
Are you using Selenium Grid?
4.21.0-20240522
The text was updated successfully, but these errors were encountered: