Skip to content
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

Cannot get onConsole working #78

Open
dk253 opened this issue Oct 9, 2017 · 1 comment
Open

Cannot get onConsole working #78

dk253 opened this issue Oct 9, 2017 · 1 comment

Comments

@dk253
Copy link

dk253 commented Oct 9, 2017

Howdy! I like you library.

I cannot seem to capture console messages from my web page. My web page has several console messages that I need to trap in order to trigger a screen capture. Everything else seems to be working great. If you could give me an example of "onConsole", that would propel me forward. Thanks!

@devishreebalasubramanian

Hi,
I have also tried to capture and save browser console messages in the text file using the following code.
But this code not works.
await mainTab.onConsole(async function(e){
console.log(e[0].value)
fs.writeFileSync('postedtoday.txt', e[0].value , {"encoding":'utf8'});
})
I have log my test messages like this.
console.log('test message');
I need to save test message in postedtoday.txt file.I can't understand the onConsole function work flow.Please help me to solve my issue.

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

No branches or pull requests

2 participants