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.

onTestFailure Hook?

See original GitHub issue

I am looking through the documentation, although I could have missed it, and it would be nice to have an onTestFailure hook or something similar, where when a test fails, I would call client.getLog and print the log associated to that failure.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rulkenscommented, Feb 19, 2018

I have the same problem. It would be very useful to somehow get the console logs when the test fails.

1reaction
kwypchlocommented, May 18, 2017

@MateuszJeziorski sorry to dig out old issue but I tried that solution, I check browser.currentTest.results.failed and try to access logs with getLogs but all I get is that exception that points to a session being closed. I do not call .end() anywhere manually for the purpose of this test. org.openqa.selenium.NoSuchSessionException

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Jest onFailure hook
I have found that there is onTestFailure option when setting up a test-runner, is it possible to leverage that?
Read more >
TestNG Listeners In Selenium Webdriver For Automated ...
onTestFailure : This method invokes every time a test case fails. Syntax: void onTestFailure(ITestResult result);.
Read more >
Test Listeners (Test Hooks) - #13 by nguyenlehoangquynh
Ideally, I'd have a hook point much earlier in the executor thread and abort there. ... OnTestSuccess, OnTestFailure, OnTestFinish, etc.
Read more >
Playwright Test Hooks
Today in this article, we will be looking at different test hooks ... the new worker as the worker process is restarted on...
Read more >
Save The Page On Test Failure
Save The Page On Test Failure ... In the support file register the afterEach hook to save the full page if a test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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