question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firefox: logs().get( "browser" ) doesn't show console errors?

See original GitHub issue

I’m trying to save the console logs after each test but having some problems with Firefox. With a test like:

describe("protractor/webdriver", function() {
    it("should be able to get browser logs", function() {
        browser.get("https://angularjs.org");

        browser.executeScript("console.log('Nothing to see here - move along.')");
        browser.executeScript("console.warn('This is your first warning!')");
        browser.executeScript("console.error('This is serious!!!')");

        browser.driver.manage().logs().get( "browser" ).then(function( logsEntries ) {
            logsEntries.forEach( (item) => {
                console.log( "LOG LEVEL:", item.level.name, item.message );
            });
        });
    });
});

For Chrome I get the result nicely:

[chrome #1] LOG LEVEL: WARNING console-api 240:41 This is your first warning!
[chrome #1] LOG LEVEL: SEVERE console-api 240:41 This is serious!!!

But Firefox only returns “Internal” warnings (CSS parse):

[firefox #2] LOG LEVEL: WARNING Unknown property 'zoom'.  Declaration dropped.
[firefox #2] LOG LEVEL: WARNING Unknown property 'user-select'.  Declaration dropped.
[firefox #2] LOG LEVEL: WARNING Unknown property 'zoom'.  Declaration dropped.
[firefox #2] LOG LEVEL: WARNING Error in parsing value for 'background-image'.  Declaration dropped.
[firefox #2] LOG LEVEL: WARNING Error in parsing value for 'background-image'.  Declaration dropped.
[firefox #2] LOG LEVEL: WARNING Expected media feature name but found '-webkit-min-device-pixel-ratio'.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:9
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
sundeep-guptacommented, Aug 16, 2016

I am having the same issue with selenium 2.53.1 and firefox 45.3ESR

4reactions
dcoraboeufcommented, Dec 8, 2015

Same issue in my case, with the same versions. Still looking for a solution, even a workaround, since having the console after the tests have run is very precious for analysis of failures. I’m using Firefox because I have to support different OS and this was the easiest to support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Console doesn't display content script errors - Mozilla Discourse
During an extension development, I noticed that the Firefox debugger console doesn't display any errors while injecting content scripts, ...
Read more >
In Firefox, console.log is not showing anything - Stack Overflow
Open the Console · Click the Logs button until grey in Filter output row on the right · Click the Settings gear on...
Read more >
Firefox: logs().get( "browser" ) doesn't show console errors ...
I'm trying to save the console logs after each test but having some problems with Firefox. With a test like: describe("protractor/webdriver" ...
Read more >
Gather console logs on Firefox
In Firefox, click > More Tools > Web Developer Tools. · With the Console tab selected, click and select Persist Logs. · Click...
Read more >
2 Easy Ways to Fix console.log if It's not Working in Firefox
1. Enable logging ... Enter the full console by right-clicking the page and selecting Inspect (or press Ctrl + Shift + K )....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found