click() isn't working: scrolling issue?
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.12.2
- Platform / OS version: uname -a Linux henrique-Latitude-5480 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic
- URLs (if applicable):
- Node.js version: v10.15.1
What steps will reproduce the problem?
I have the following piece of code, in a simplified way:
await Promise.all([
_ifrArvoreFrameSEI.waitForNavigation(), //_ifrArvoreFrameSEI is class: Frame
_ifrVisualizacaoSEI.waitForNavigation(), // _ifrVisualizacaoSEI is class: Frame
_ifrArvoreFrameSEI.click('a#anchor18335653')
]);
What is the expected result? Click on element ‘a#anchor18335653’ and resolves the waitForNavigation() promises.
What happens instead? sometimes waitForNavigation timeouts
So I ran Chrome with graphical interface, and verified that _ifrArvoreFrameSEI.click(‘a#anchor18335653’) doesn’t seem to be scrolling. When I have the following screen, it works:
But on this one, it doesn’t work:
I think the problem might be in the scroll bar marked with Red, as puppeteer doesn’t seem to be scrolling it. Sorry for the black stripes, I had to add them because the screen potentially shows private data.
‘a#anchor18335653’ is shown below.
When I manually scrolled the bar, in the 5 seconds given by Atomics.wait, it works:
var sab = await new SharedArrayBuffer(1024);
var int32 = await new Int32Array(sab);
await console.log("SLEEPING");
await Atomics.wait(int32, 0, 0,5000);
await Promise.all([
_ifrArvoreFrameSEI.waitForNavigation(),
_ifrVisualizacaoSEI.waitForNavigation(),
_ifrArvoreFrameSEI.click('a#anchor18335653')
]);
It woks if Chrome is launched with defaultViewport: {width: 2000, height:2000}
I’ve also noticed that the code bellow works fine:
await Promise.all([
_ifrArvoreFrameSEI.waitForNavigation(), //_ifrArvoreFrameSEI is class: Frame
_ifrVisualizacaoSEI.waitForNavigation(), // _ifrVisualizacaoSEI is class: Frame
_ifrArvoreFrameSEI.evaluate( () => document.querySelector('a#anchor18335653').click())
]);
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@hlr1983 thank you very much! I was able to repro and add a failing test; we’ll fix it shortly.
Ok. Sent to lushnikov[at]google.com