Chromeless: Click is not working all the times

Created on 14 Aug 2017  路  6Comments  路  Source: prisma-archive/chromeless

In some of my test runs, the click method is not working and I have to manually select and click the element

 .evaluate(function() {
                        document.querySelector('a[href="page-1"]').click();
                    })

I can also do the job correctly if I run select and click in Chrome Console.

Unfortunately I can't share a sample as it's a proprietary app.

Error:

wait("a[href="page-1"]")
timed out after 10000ms
question

All 6 comments

Try initiating chromeless with new Chromeless({scrollBeforeClick: true}). If the element is out of the viewport then chromeless is not able to click on it so you need to scroll to it before click. That option will do it automatically before every click.

You can also use the implicit wait together with scrollBeforeClick option like new Chromeless({scrollBeforeClick: true, implicitWait: true}) to make chromeless wait for the node to be present in the DOM before clicking on it.

Hi,

I can't find where the scrollBeforeClick option is documented ?

Best regards

I just made a PR with the documentation: https://github.com/graphcool/chromeless/pull/243/files

The source has more documentation than the documentation:
https://github.com/graphcool/chromeless/blob/master/src/types.ts#L40

Thanks @janza for adding to the doc.

In a related issue (#290), I tried setting the viewPort larger without success.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

just-boris picture just-boris  路  5Comments

maruidea picture maruidea  路  6Comments

Corefinder89 picture Corefinder89  路  4Comments

schickling picture schickling  路  5Comments

abotkugyu picture abotkugyu  路  3Comments