angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Protractor - log type 'performance' not found error #5270

Open sumxyz opened 5 years ago

sumxyz commented 5 years ago

webdriver-manager 12.1.5

protractor Version 5.4.2

Chrome version 75.0.3770.100

browser.manage().logs().get('performance');

This used to work fine before upgrading my webdriver-manager and protractor version.

(node:27715) UnhandledPromiseRejectionWarning: WebDriverError: invalid argument: log type 'performance' not found
 (Session info: chrome=75.0.3770.100)
 Build info: version: '3.141.59', revision: 'e82be7d358', time:    '2018-11-14T08:25:53'
System info:, os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.4', java.version: '1.8.0_191'
 Driver info: driver.version: unknown
at Object.checkLegacyResponse (node_modules/selenium-webdriver/lib/error.js:546:15)

If I comment the browser.manage().logs().get('performance'); and other performance related code, then the test runs fine.

webdriver-manager logs show:

Starting ChromeDriver 75.0.3770.90 on port 12268

DublinDev commented 5 years ago

This stack overflow thread has a work around for webdriver with java. Is there a way to recreate the same functionality for Protractor?

sumxyz commented 5 years ago

Could really use some help with this issue. Thank you.

harsha509 commented 5 years ago

Hi @sumxyz , the same capability works for chrome 74, it doesn't work with 75. It seems like an issue with chrome driver, not really an webdriver-manager issue.

For workaround you can uninstall webdriver-manager@12.1.5 and use webdriver-manager@12.1.4 to make your existing script to work.

Thanks.

DublinDev commented 5 years ago

@Harsha509 In that stack overflow thread I posted the poster suggests the change was made in chromedriver to comply with the w3c standards more strictly. If that is the case this is unlikely to change back so shouldn't this new functionality be handled by Protractor?

harsha509 commented 5 years ago

@DublinDev , i have seen the post just now, thanks a lot for your research. Yes it should be handled by protractor and a user working with protractor@5.4.2 should install webdriver-manager@12.1.4 instead of 12.1.5.

It might work with protractor@6.x.x, as it has selenium4-alpha, which follows w3c protocol. For now, yes it is an issue for people working with protractor@5.4.2 and chrome version 75.

JosephBittman commented 5 years ago

Hi - I am using chrome 76 and chromedriver 77, so your milage may vary, but adding the w3c flag (to false) in capabilities is required to access the performance log type.

Those log types are hidden behind that flag due to w3c compliance issues. It likely is the case in the slightly older driver version you are using.

capabilities: { browserName: 'chrome', loggingPrefs: { browser: 'ALL', driver: 'ALL', performance: 'ALL', }, 'goog:chromeOptions': { args: ['disable-infobars'], perfLoggingPrefs: { enableNetwork: true, }, w3c: false, }, elementScrollBehavior: 1, };

DublinDev commented 5 years ago

@JosephBittman that seems to solve the issue for me anyway! thanks.

Also @Harsha509 I didn't actually mean to imply that that was my answer or research, I just found the thread on stackoverflow.

sumxyz commented 5 years ago

thank you ... protractor@5.4.2 with webdriver-manager@12.1.4 instead of 12.1.5. helped!

wuhuhuan commented 4 years ago

@JosephBittman Hi - I am using chrome 79 ,how to reslove the problem!!! selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: log type 'performance' not found