1

After I have been doing any automated task with selenium webdriver, I check the javascript log to see if anything unexpected has happened.

To do that, I am using

browser.Manage().Logs.GetLog(LogType.Browser).Where(l=>l.Level != LogLevel.Warning);

(This will only give me critical log entries).

Why am I also getting log entries for 500 internal server error?

Shouldn´t that belong to the logkind LogType.Server?

2

LogType.Browser is intended to show the javascript errors that you can observe in browser's JS-console. So if the log message appears in that console, then you'll see such the message there.

LogType.Server does not refer to the server component of your application under test. It defines the log messages that are produced by Selenium server component.

LogType.Client, for example, defines the messages that are produced by Selenium client-side protocol that you use in your code.

UPD:

  • Here you can find some details on what client and what server is
  • Here you can find some details on how logging is implemented in Selenium
  • And LogType.Client will include the javascripts error then? – Anders Lindén Oct 15 '18 at 13:29
  • Getting unknown error: log type 'client' not found (Session info: chrome=69.0.3497.100) (Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 10.0.17134 x86_64) – Anders Lindén Oct 15 '18 at 13:33
  • Log type does not define the type of error you expect to get. It is rather the place where the log entry appears. Anything related to js issues may or may not appear in client log, depending on the particular implementation. However it is more natural to expect sich kind of errors in BROWSER logs. See some references in my answer update – Alexey R. Oct 15 '18 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.