Menu

Enabling soft failures

Help
Stopgap
2007-04-12
2013-04-25
  • Stopgap

    Stopgap - 2007-04-12

    Hello,

    I've just started working on creating my own custom plug-in for Jameleon that uses the Selenium libraries to interact with the browser. I've made several custom tags and can execute a test case just fine, as long as all of the tags result in a pass. When a tag fails, however (either by using fail() or by some assert method in testBlock()), the whole test case stops dead, complaining about the single failure.

    I would prefer it if, after hitting a failure, the test case would continue, regardless of the potential problems caused by that step not functioning properly. This way I'd be able to catch any further errors as well.

    I do not mean that I am expecting a certain step to fail (otherwise I would use an "expected failure" tag of some sort), but rather that if I hit an unexpected failure, I'd still like the test case to execute to completion.

    Does Jameleon (or the Selenium plug-in/session tag) have a way (an attribute, config setting, or flag of some sort?) to keep executing the test case regardless of failures, while still outputting the failure information?

    Thanks.

     
    • Christian Hargraves

      The simplest way to do this would be to encapsulate your test in a <postcondition/> tag. For example,

      <testcase>
         <postcondition>
           <selenium-session ...>
              <do-something/>
              <do-something-else/>
              <do-yet-another-action/>
              ...
           </selenium-plugin>
         </postcondition>
      </testcase>

      All of your error messages will a "POSTCONDITION: " prefix. Let me know if this is acceptable.

       
    • Stopgap

      Stopgap - 2007-04-13

      Yeah, that seems to work how I was hoping. Thanks for your prompt response! :)

       

Log in to post a comment.