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

Some new browser logs are not captured #1914

Closed
juliemr opened this issue Apr 4, 2016 · 4 comments
Closed

Some new browser logs are not captured #1914

juliemr opened this issue Apr 4, 2016 · 4 comments
Labels

Comments

@juliemr
Copy link
Contributor

juliemr commented Apr 4, 2016

Meta -

OS: OSX 10.11.3
Selenium Version: v2.52.0
Browser: Chrome
Browser Version: 49.0.2623.87

Behavior

I have a sample site which logs an error to the browser console using console.error('foo') once on load and once two seconds later.

console.error('first');
setTimeout(function() {
  console.error('second');
}, 2000);

I run webdriver against it and capture browser logs once right away and once ten seconds later. I expect the second error to show up in the second captured logs, but instead it is empty:

driver.manage().logs().get('browser').then(function(logs) {
  console.log('------ first logs:');
  console.log(logs); // This has the first error, as expected.
});

driver.sleep(10000);

driver.manage().logs().get('browser').then(function(logs) {
  // The page logs a second error in the past 10 seconds, but these are emtpy.
    console.log('------ second logs:');
    console.log(logs); // This is empty - the second error is lost.
});

Steps to reproduce -

Script showing the issue at: https://github.com/juliemr/webdriver-bugs/blob/master/no-new-logs.js
The site it's testing against is: https://github.com/juliemr/webdriver-bugs/blob/gh-pages/index.html

@amrsh
Copy link

amrsh commented Aug 18, 2016

+1: after each test we check for errors in the log; we get an empty log if the test itself calls browser.manage().logs().get('browser'), thus missing errors.

@MihailStopnik
Copy link

MihailStopnik commented Nov 14, 2016

+1, got the same issue when trying to clear logs with ' browser.manage().logs().get('browser');'
Next attempt to get logs fails

@ElPsyCongro
Copy link

+1

@barancev
Copy link
Member

There is nothing here we can fix on Selenium side, the issue should be reported to browser vendors (that implement driver executables)

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants