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.

Print selenium test statistics in the test log during the tests execution

See original GitHub issue

Description

Sometimes it is useful to know the current progress of selenium tests executing. For example, it could help to stop test execution in case of significant regression, or if there is too big latency at the product side.

As a variant, we can print such statistics in test log at the start of each test:

Start of test org.eclipse.che.selenium.miscellaneous.DialogAboutTest#dialogAboutTest
Executed tests: 120
Failed tests: 2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vzhukovscommented, Feb 22, 2018

Sounds good

0reactions
dmytro-ndpcommented, Feb 22, 2018
An example of logs
2018-02-21 20:01:06,134[main]             [INFO ] [.e.c.s.c.i.SeleniumTestHandler 203]  - Starting suite 'Multi-thread Eclipse Che tests' with 2 test methods.
2018-02-21 20:01:06,168[pool-1-thread-1]  [INFO ] [.e.c.s.c.i.SeleniumTestHandler 161]  - Starting test #1 NavigateToFileTest.shouldNavigateToFileForFirstProject. Passed: 0, failed: 0, skipped: 0.
2018-02-21 20:01:06,174[pool-1-thread-1]  [INFO ] [.e.c.s.c.i.SeleniumTestHandler 236]  - Dependencies injection in org.eclipse.che.selenium.miscellaneous.NavigateToFileTest
2018-02-21 20:01:06,236[pool-1-thread-1]  [ERROR] [.e.c.s.c.i.SeleniumTestHandler 287]  - Test org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject failed because error: ------ shouldNavigateToFileForFirstProject
2018-02-21 20:01:06,256[pool-1-thread-1]  [INFO ] [.e.c.s.c.i.SeleniumTestHandler 161]  - Starting test #2 NavigateToFileTest.shouldNavigateToFileForFirstProject (run 2). Passed: 0, failed: 1, skipped: 0.
2018-02-21 20:01:06,257[pool-1-thread-1]  [ERROR] [.e.c.s.c.i.SeleniumTestHandler 287]  - Test org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject (run 2) failed because error: ------ shouldNavigateToFileForFirstProject
2018-02-21 20:01:06,260[pool-1-thread-1]  [INFO ] [.e.c.s.c.i.SeleniumTestHandler 161]  - Starting test #3 NavigateToFileTest.shouldNavigateToFileForFirstProject (run 3). Passed: 0, failed: 2, skipped: 0.
2018-02-21 20:01:06,261[pool-1-thread-1]  [ERROR] [.e.c.s.c.i.SeleniumTestHandler 287]  - Test org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject (run 3) failed because error: ------ shouldNavigateToFileForFirstProject
2018-02-21 20:01:06,265[pool-1-thread-1]  [INFO ] [.e.c.s.c.i.SeleniumTestHandler 161]  - Starting test #4 NavigateToFileTest.shouldNotDisplayHiddenFilesAndFoldersInDropDown. Passed: 0, failed: 3, skipped: 0.
2018-02-21 20:01:06,331[main]             [INFO ] [.e.c.s.c.i.SeleniumTestHandler 487]  - Cleaning up test environment...
2018-02-21 20:01:06,332[main]             [INFO ] [.e.c.s.c.i.SeleniumTestHandler 339]  - Processing @PreDestroy annotation in org.eclipse.che.selenium.miscellaneous.NavigateToFileTest
[ERROR] Tests run: 5, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 7.255 s <<< FAILURE! - in TestSuite
[ERROR] shouldNavigateToFileForFirstProject(org.eclipse.che.selenium.miscellaneous.NavigateToFileTest)  Time elapsed: 0.082 s  <<< FAILURE!
java.lang.AssertionError: ------ shouldNavigateToFileForFirstProject
	at org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject(NavigateToFileTest.java:65)

[ERROR] shouldNavigateToFileForFirstProject(org.eclipse.che.selenium.miscellaneous.NavigateToFileTest) Time elapsed: 0.002 s <<< FAILURE! java.lang.AssertionError: ------ shouldNavigateToFileForFirstProject at org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject(NavigateToFileTest.java:65)

[ERROR] shouldNavigateToFileForFirstProject(org.eclipse.che.selenium.miscellaneous.NavigateToFileTest) Time elapsed: 0.002 s <<< FAILURE! java.lang.AssertionError: ------ shouldNavigateToFileForFirstProject at org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject(NavigateToFileTest.java:65)

[ERROR] tearDown(org.eclipse.che.selenium.miscellaneous.NavigateToFileTest) Time elapsed: 0.004 s <<< FAILURE! java.lang.AssertionError: ------ tearDown at org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.tearDown(NavigateToFileTest.java:72)

[INFO] [INFO] Results: [INFO] [ERROR] Failures: [ERROR] org.eclipse.che.selenium.miscellaneous.NavigateToFileTest.shouldNavigateToFileForFirstProject(org.eclipse.che.selenium.miscellaneous.NavigateToFileTest) [ERROR] Run 1: NavigateToFileTest.shouldNavigateToFileForFirstProject:65 ------ shouldNavigateToFileForFirstProject [ERROR] Run 2: NavigateToFileTest.shouldNavigateToFileForFirstProject:65 ------ shouldNavigateToFileForFirstProject [ERROR] Run 3: NavigateToFileTest.shouldNavigateToFileForFirstProject:65 ------ shouldNavigateToFileForFirstProject [INFO] [ERROR] NavigateToFileTest.tearDown:72 ------ tearDown [INFO] [ERROR] Tests run: 3, Failures: 2, Errors: 0, Skipped: 0

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use TestNG Reporter Log In Selenium - LambdaTest
In this Selenium TestNG tutorial, we will learn about the Reporter Class in TestNG along with the different parameters it offers.
Read more >
How can I print in log the number of tests running as part of ...
And there are 10 methods in class GroupTestExample which comes under group functest, it should print 10 in log as soon as it...
Read more >
Debugging Selenium Scripts with Logs (Log4j Tutorial)
Log4j Tutorial - In this Selenium tutorial, we would discuss about the logging feature, its potential, debugging capabilities and much more.
Read more >
How to use TestNG Reporter Log in Selenium: Tutorial
Step by Step Tutorial to use TestNG Reporter Log in Selenium. Learn to generate Reports using TestNG Reporter class using examples.
Read more >
How to use TestNG Reporter Log in reporting with Selenium ...
How to use TestNG Reporter Log and How to print important messages and do logging in TestNG Reports with Selenium Examples.
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