-
Notifications
You must be signed in to change notification settings - Fork 675
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
Unable to click an element as it does not scroll above the webpage footer #2601
Comments
Hi @srijitdas8, I've reproduced the problem. |
Hi Guys....Any luck with the issue. Appreciate your help...Thanks |
Hi @srijitdas8, I'm working on this. |
Hi @srijitdas8 |
Hi @AlexKamaev and @AndreyBelym, since upgrading from version 0.20.5 to 0.21.1 I suddenly started experiencing the same issue as #2450. This seems to be a new issue as of the newer versions, because on version 0.20.5 this was not a problem. In 0.20.5, it would scroll to avoid the fixed element, but I don't see that same scrolling behavior happening in 0.21.1. |
Hi @edenadler |
Hi @AlexKamaev. I'm not able to share the test page and file, but I found a solution to the problem. The problem was that it is only scrolling horizontally but not vertically. I can submit a pull request for it. Since #2450 is already closed, let me know what ID I should submit it with. |
I'm happy to hear that you solved the issue. If you think that it was connected to #2450, you can submit your PR with its ID. I'll take a look at your PR and review it; otherwise, you are free to open a separate issue and post it there. |
@AlexKamaev PR submitted #2812 |
Thanks, I'll take a look |
I've reviewed the PR and found that you toggle |
I'm closing this since there was no activity here for a long time. Feel free to reopen the issue if it's still actual. |
any update for this issue? i don't think it's solve. I face the same issue |
@tbcoyle |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Thank you for investigating. It is odd that the issue seems to be reproducible only in Firefox, as I am using Chrome. Perhaps there is an issue with my example file. Please see below another example on a live site (note - I am running with "skipJsErrors": true): import {Selector as $} from 'testcafe';
fixture`Testcafe 2601`
.page`https://www.kcrw.com`;
test('Case A - Click fails - target element is within window but fully subsumed by fixed footer', async (t) => {
const TARGET_INDEX = 4; // svg.icon-more is WITHIN window for 4th index
await t
.resizeWindow(1500, 800)
.click('a.logo-link')
.click('#nav-playlist')
.click($('div.track.clearfix:not(.episode_Break)').nth(TARGET_INDEX).find('svg.icon-more'));
await t
.wait(2000)
.expect(await $('div.track.clearfix.expanded').count)
.eql(1, 'Successfully clicked the more-info arrow and expanded row');
});
test('Case B - Click succeeds - target element is below window and scroll occurs successfully', async (t) => {
const TARGET_INDEX = 5; // svg.icon-more is BELOW window for 5th index
await t
.resizeWindow(1500, 800)
.click('a.logo-link')
.click('#nav-playlist')
.click($('div.track.clearfix:not(.episode_Break)').nth(TARGET_INDEX).find('svg.icon-more'));
await t
.wait(2000)
.expect(await $('div.track.clearfix.expanded').count)
.eql(1, 'Successfully clicked the more-info arrow and expanded row');
}); Here is what I see for Case A:
The issue in this example is that Testcafe should have scrolled before clicking in step 4. With Case B, you can see that Testcafe does indeed scroll before clicking, which is the intended behavior. The difference between Case A and Case B is simply that in Case A the target element is contained within the current window (but hidden beneath the fixed footer), whereas in Case B the target element is below the window. Given the above, I would suspect that the mechanics of scrolling is working properly - the issue may be with deciding under what conditions a scroll should occur. I did a little more investigating and found that the issue appears to have been introduced between Testcafe v0.22.0 and v0.23.0. I am seeing the test for Case A passing in v0.22.0 and failing in v0.23.0. Please let me know if I can provide any additional information - we are motivated to be helpful as we are stuck in v0.22.0 for now. |
@tbcoyle |
@tbcoyle |
@AlexKamaev I am surprised! I have the same problem in Chrome, Firefox and Opera. It only works in Edge and Safari. Page doesn't scroll to element and tests are always failed. This is a basic function. How can this not work? |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Are you requesting a feature or reporting a bug?
Bug
What is the current behavior?
The webpage under test has a footer and the button to be clicked scrolls and comes behind the footer. Due to this, testcafe is unable to click on the button and the script fails.
Workaround used: Tried to use a client function with “ScrollBy” function. This works inconsistently. Works in one environment but does not work on another test environment
What is the expected behavior?
The button scrolls up automatically into the browser viewport above the webpages footer and testcafe is able to click the button
How would you reproduce the current behavior (if this is a bug)?
Since I am unable to share our application under test in our test environment. testcafe script with an sample website with similar footer and similar issue is provided below.
Provide the test code and the tested page URL (if applicable)
Attached testcafe script has the details
Tested page URL:
Test code
===================================
Testcafe sample code:
===================================
Specify your
*Browser version: 67.0.3396.99 (Official Build) (64-bit)
*NPM: 5.6.0
The text was updated successfully, but these errors were encountered: