Given I have the following class (See Parallelized Runner for more information on parallel runs):

public class TopicTest {

    String topic;

    public TopicTest(String topic) {
        this.topic = topic;

    public void testTopicPage() {
       WebDriver driver = new FirefoxDriver();
       driver.get("http://www.mysite.com/topics/" + topic + "/");
       TopicPage topicPage = PageFactory.initElements(driver, TopicPage.class);
       Assert.assertTrue("No items were located on this topic page <" + topic + ">", topicPage.elementsFound());

    public static Collection<Object []> topics() {
        List<Object []> parameters = new ArrayList<Object []>();
        for(String s : new String [] { "topic1", "topic2", "invalidTopic" }) {
            parameters.add(new Object [] { s });
        return parameters;

     public static class TopicPage {
         @FindBy(className = "result-set-a")
         private List<WebElement> items;

         public boolean elementsFound() {
             return items != null && items.size() > 0;

Is there anyway that I can get more information out of my test run other than pass / fail status? I can get the following information on my failed runs due to the assertion error:

junit.framework.AssertionFailedError: No recipes were located on this topic page <invalidTopic>

Is there a way that I could get more information out from our passing tests for reporting purposes?

  • Scott, what kind of information do you have in mind? More specifically, do you want information that JUnit already has, or do you envision adding logging calls to your tests?
    – user246
    Commented Feb 22, 2012 at 14:42
  • For instance with this test I will see the one assertion error, but not see anything for the other two topics, it'd be nice to see that topic1, topic2 passed without needing to look at the code to see which items were tested.
    – Scott
    Commented Feb 22, 2012 at 17:43

1 Answer 1


If I understand the question, the issue is not so much about parallelized tests as it is about the JUnit runner's policy of reporting failures individually but only reporting successes in aggregate. If you want successes to be reported individually, I suggest you register a custom RunListener. The RunListener will be invoked each time an event occurs during the test, e.g. when a test starts, when it finishes, and when it fails.

Another avenue to investigate would be the TestWatcher class.

  • I should have thought of the TestWatcher first, as I had already been using that to report status messages back to Sauce Labs, which I had done in a POC.
    – Scott
    Commented Feb 23, 2012 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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