Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Trying to grok 'Error: [object Object]' #66

Open
rentallect opened this issue Nov 8, 2017 · 1 comment
Open

Trying to grok 'Error: [object Object]' #66

rentallect opened this issue Nov 8, 2017 · 1 comment

Comments

@rentallect
Copy link

I'm learning navalia, and have a test that looks on the page for a certain element, like this:

.then(() => chrome.exists('[#ns-leftdrawer-list-item--atlas]'))

it succeeds, and my test then attempts to click on a child element, like this:

chrome.click('[#ns-leftdrawer-list-item--atlas > a]')

this fails, and the chatter from navalia says this:

navalia:chrome :WARN > Retrying 1 time(s) due to issue: 'Error: [object Object]' +10ms

My question is: how do I get visibility into what the error actually is? Is there a way to dump/format the [object Object]?

@joelgriffith
Copy link
Owner

Yeah, it's likely that the error that's happening isn't being properly handled or printed by navalia. I'm recommending now that people take a look at other libraries like puppeteer or chromeless as those two have a lot more steam behind them. You can run your script with DEBUG=* node ... and navalia will print dump a lot more logs about what's going on.

Also: your exists/click references don't use the exact same selector.... which I'm not sure is intended or not. Just thought I'd post it out.

And finally, I've been working on a SaaS product that has a really nice debugger for figuring out why things like this happen. You can check it out at https://browserless.io/ and click the "try it out" button. Only caveat here is that the debugger only lets you use puppeteer, but the tooling for it is really really nice.

Failing all that, let me know and I can try and jump in and debug with you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants