-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[🐛 Bug]: element.scrollIntoView() throws "Request failed with status 500 due to move target out of bounds: move target out of bounds" #11866
[🐛 Bug]: element.scrollIntoView() throws "Request failed with status 500 due to move target out of bounds: move target out of bounds" #11866
Comments
This seems like an error in the logs and not an error in the test |
Thanks for reporting! We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers! |
@christian-bromann @erwinheitzman @spencerlavallesonos I believe It's because actions will be taking x,y from origin, regarding w3c documentation, not from calculated arguments {x: deltaX, y: delataY}. I suggest {x,y} can't be used with origin it's always will be error. https://www.w3.org/TR/webdriver2/#wheel-actions Let (x, y) be the result of trying to get coordinates relative to an origin with source, x offset, y offset, origin, browsing context, and actions options. If x is less than 0 or greater than the width of the viewport in CSS pixels, then return error with error code move target out of bounds. If y is less than 0 or greater than the height of the viewport in CSS pixels, then return error with error code move target out of bounds. i've tried my assumption and it's working the same but without error and fallback instead of
this one
|
here is reproduceable an example https://github.com/udarrr/moveToExample, please don't see name of the repo as it my old one) moreover it seems wheel actions perform 'nearest' behavior by default for origin |
@udarrr thanks, I have already put my name on the issue to look into it when I can |
I'm noticing this issue as well while I'm updating to v8. I may take a look at some point after I fix some other things. |
I actually am unable to reproduce this with the examples given, @WillBrock do you have a simple reproducible example for this? |
@erwinheitzman You're unable to reproduce the bug even with the repo I linked in my initial issue summary? I just cloned, ran |
@spencerlavallesonos you're right, I didn't check the logs. I'll refer back to my answer here: #11866 (comment) Logs are logs, they are meant for debugging purposes only like in any other piece of software. |
@erwinheitzman If something is wrong with logs, shouldn't that be addressed? The issue I'm reporting is that these printouts are present when there's no evident issue interacting with the element. If this is the correct interaction, we should suppress the logs or fix the cause for the logs. |
As long as the errors are not printed to e.g. stdout and give a wrong impression that something actually is wrong I am alongside @erwinheitzman that logs should show what actually happens during the test. If WebdriverIO retries certain errors then it should log those errors too. |
I am confused, in my tests I see this error, but then my tests pass. If there was an error in the log why are my tests passing? |
How do you see this error, mind providing a screenshot?
Because WebdriverIO tries different things to achieve what you are trying to do. It uses WebDriver's action API first to attempt scrolling the element into view. We do this as we believe it is the closes way to a user interaction. If we fail due to the error mentioned in the OP, we fall back to use the Web API for it which does the job but is not our preferred solution since no scroll events are fired. Again, as long as these errors are in the log files only, it should be fine. |
@nrstaber are these logs from your terminal or an excerpt from a file? |
Yes. I got all for this one thread.
|
I see, yes, these error messages should be suppressed. |
@christian-bromann these errors are only shown because when you do not specify a outputDir (which is the default) all the logs are shown in the terminal as the default logLevel is set to info iirc. Setting the outputDir gets rid of the logs and thus the error. |
@nrstaber can you verify that you don't have |
I can verify that I don't have |
@nrstaber can you verify that you have |
Yes, it is set to error. |
Gotcha. So yeah in this context the error message can be confusing but I don't really have an idea what would be a better approach. Any feedback would be appreciated. |
I would think it should be suppressed as |
@spencerlavallesonos I think we can certainly make improvements so let me list what I think are things we could work on. Takeaways for us:
My advice to you:
|
Something I suggest to add to the list is amend the error message to tell folks that this error message can be ignored as WebdriverIO attempts to recover from it. It might even make sense to change the logLevel here to |
I agree with @christian-bromann that this 500 error shouldn't be included in |
This sounds similar to the no alert error that prints to the console. We don't set the outputDir when running tests locally because it makes sense to see everything in the console when things fail. We just updated to v8 and we see these errors in the console and multiple devs have reported it as errors when running their tests when it is not an error. In v7 this did not happen. It just clutters the console and makes things look like they fail but they pass. I'm not sure the best approach but I think we should suppress them somehow. |
@WillBrock I pushed a release yesterday which included #12383 that should resolve the issue. I think we can close the issue. |
Awesome, thanks! |
After updating to the latest release the error still display in terminal. |
Can you share a screenshot? |
@ivanovicuros can you make sure to update all your WebdriverIO dependencies (make sure you nuke your package-lock.json and reinstall everything)? As mentioned above this should be fixed now. If you still see this after updating, mind providing a reproducible example? |
@christian-bromann #12383 changes some of the hardcoded errors but not the I updated to 8.32.4, removed node_modules, package-lock and npm i but still have the error. |
@WillBrock interesting, do you have a minimal reproducible example for this? |
It's just the same thing what the original poster put in the description with the repo linked. https://github.com/spencerlavallesonos/wdio-bug-scrollIntoView |
Confirmed still happening even when updating my test repro repo to latest wdio release @christian-bromann |
I pushed another fix that removes the error message. |
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
latest
Node.js Version
18.17.1
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
When using
element.scrollIntoView()
the error/ warning "Request failed with status 500 due to move target out of bounds: move target out of bounds" is thrown even if thescrollIntoView()
is executed successfullyWhat is your expected behavior?
If a move target is in boundary (is currently on the screen and visible), scrolling to it shouldn't throw an error that the target is out of bounds.
In this example Sonos.com's main "Shop" button on the top navigation-bar.
How to reproduce the bug.
Clone this repo, follow the readme, see the output.
Relevant log output
The text was updated successfully, but these errors were encountered: