-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
CypressError: Timed out retrying: coordsHistory must be at least 2 sets of coords #3738
Comments
Error being thrown: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/actionability.coffee#L200 Yeah, this is not a great error message. Can you provide a reproducible example so that we can recreate this? App code + test code - just make a small repo of the isolated problem, not your entire repo. I tried doing |
<div flex="30" style="margin-top:10px" class="flex-30">
<md-checkbox class="blue ng-pristine ng-untouched ng-valid ng-empty" ng-model="entity._profile.ext.minutebook_local" aria-label="minutebook location" ng-disabled="userMinutebook.access === 'read-only' || userMinutebook.access === 'summary-only'" tabindex="0" type="checkbox" role="checkbox" aria-disabled="false" aria-checked="false" aria-invalid="false">
<div class="_md-container md-ink-ripple" md-ink-ripple="" md-ink-ripple-checkbox="">
<div class="_md-icon"></div>
</div>
<div ng-transclude="" class="_md-label">
<span class="ng-scope">Minutebook is at our office</span>
</div>
</md-checkbox>
</div>
<div flex="30" class="flex-30">
<md-checkbox class="blue ng-pristine ng-valid ng-empty ng-touched" ng-model="entity._profile.ext.corp_seal" aria-label="corporate seal" ng-disabled="userMinutebook.access === 'read-only' || userMinutebook.access === 'summary-only'" tabindex="0" type="checkbox" role="checkbox" aria-disabled="false" aria-checked="false" aria-invalid="false" style="">
<div class="_md-container md-ink-ripple" md-ink-ripple="" md-ink-ripple-checkbox=""> .
<div class="_md-icon"></div>
<div class="md-ripple-container"></div>
</div>
<div ng-transclude="" class="_md-label">
<span class="ng-scope">Corporate seal</span>
</div>
</md-checkbox>
</div> like this 13 elements only ng-model was different everything else is same cy.get('div._md-container.md-ink-ripple').click({multiple:true}) to select multiple check box |
@mmsudy I think the styles would need to be provided as well. The provided html alone does not seem to produce the required effect needed for testing - the checkboxes are not visible. |
|
@mmsudy Can you provide the css from your stylesheet that affects these DOM elements where I can copy and paste them into my own stylesheet? Thanks! |
|
Hey @mmsudy, why did you close the issue? Did you resolve the problem? |
@jennifer-shehane No not yet |
I've still been unable to reproduce this exactly with the html, css, and test code provided. Please comment in this issue with a reproducible example and we will reopen the issue. 🙏 |
I'm running into this too, I suspect that the missing ingredient was CSS that pushes some of the to-be clicked elements out of the viewport |
If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. |
I have experienced this problem too. Apparently Cypress cannot get all the elements if a subset of them are outside the viewport. I temporarily solved it using a cycle, selecting only a small number of elements in each iteration |
@mmsudy I was also searching solution for this particular problem nd the below ode worke for me: cy.get('div._md-container.md-ink-ripple').click({multiple:true force: true}) Also add force: true. This worked for me hope works for you as well. |
This is happening occasionally in our Windows Appveyor tests https://ci.appveyor.com/project/cypress-io/cypress/builds/38219970/job/2pjd3fi6s1kwe30c It's very flaky though - so it's hard to reproduce reliably. |
Internal Jira issue: TR-707 |
I found the key to reproducing this is slowing the browser down using Chrome's Performance tab options:
The reason this happens is that we only increase the default timeout (4000ms) by 50ms per click when there are multiple clicks, so if the system is resource-constrained and the execution is slow, it's not enough time to perform each click, especially if there are decent number of clicks. The error message is definitely misleading. It should say something like 'Timed out attempting to click multiple elements'. The coordsHistory bit is a red herring and just happens to be the error that gets picked up when the command times out. The timeout duration in the error message is also wrong. It says it timed out after 4050ms, but it should be 4300ms or so. We settle on the timeout too early, but it's dynamic based on the number of clicks. We should fix the error message, but that still leaves a question to be answered. Should we only fix the error message because it's the expected behavior that clicking multiple elements should happen within the required time frame? Then the user would be expected to increase the timeout for that click command, since it's going to take too long to click every element with the default timeout. Or is the timeout we add per click too short and we should increase it so this is less likely to happen? With a slow enough system, even increasing it to 150ms, for example, might not be enough and still require setting a custom, higher timeout for the click, but maybe there's a more reasonable amount than 50ms. |
@chrisbreiding I didn't understand there being a specific click increased timeout of 50ms. This isn't documented anywhere. I would kind of assume with multiple clicks that each click would have default timeout of 4000ms. So clicking 3 elements would be 12000ms. I dunno, this secret timeout is weird to me. I would like a solution that is the most common sense solution and for it to be well documented. Let's not just blindly increase it to 150ms. But think how the solution can work for most use cases without the timeout to begin with. Anything that can reduce flake with network variation will be a win. |
It was news to me too. I talked to Brian about it, and he said it's an oversight and each click should get the full 4000ms timeout. I'm working on fixing that, the error message, and I'll update the click doc too. |
The code for this is done in cypress-io/cypress#15643, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
@jennifer-shehane @brian-mann @bahmutov #coordsHistory
Current behavior:
Desired behavior:
Steps to reproduce: (app code and test code)
want to select all check boxes once at a time so, used
div
classVersions
cypress Version 3.1.5 , OS Windows 10, Chrome 72
The text was updated successfully, but these errors were encountered: