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
[py] Rounded pause duration #6300
Conversation
WebDriver standard expects "duration" parameter of "pause" action to be integer. ChromeDriver does not care, but GeckoDriver is very strict on this. See mozilla/geckodriver#1355
In Python2 round returns a float
@Dakkaron currently, passing a non-integer will raise a Following the principles of "exclicit is better than implicit" and "errors should never pass silently", I feel like that behavior is more correct than implicitly rounding duration to an integer. |
In Selenium for Python the If you want to wait for fractions of seconds, this is currently not possible (as laid out in the linked thread), because what happens there is you pass 0.5 seconds, these get multiplied to 500.0 milliseconds. The problem here is that when you multiply an integer by a float you get a float, not an integer, so this raises said exception. There is no way to pass fractions of a second as an integer second value. The ChromeDriver is very lax on the standard and allows floats there, but GeckoDriver is very strict and forbids floats here. Because of this, it is absolutely necessary to allow floats and cast them to int, except you want to rework Selenium so that |
This problem also has been reported here #6295. |
@Dakkaron thanks for the explanation. We definitely want to allow fractions of a second. I don't think we need the |
@lmtierney Thanks for the answer. Should I remove the round()? |
@Dakkaron yeah go ahead and remove the |
@lmtierney Did it, can be merged now. Thank you! |
Merged, thank you for your contribution! |
Thank you! |
When specifying a fraction of a second, the multiplication of 1000 causes a float value to be sent to the endpoint which causes an error
WebDriver standard expects "duration" parameter of "pause" action to be integer. ChromeDriver does not care, but GeckoDriver is very strict on this. See mozilla/geckodriver#1355
X
in the preceding checkbox, I verify that I have signed the Contributor License Agreement