Service Virtualization

  • 1.  DATA SET looping even on Assertion Failure

    Posted Mar 28, 2017 02:35 AM

    I have a data set with 10 inputs, If first 2 inputs returns success and the third input fails due to assertion, is there a way that I can still move to the fourth input in my data set? As of now, the assertion is failing the entire test step. (I have given if false, then fail the step  - In my assertion)

     

    Note: I am working on REST STEP - Web services



  • 2.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 28, 2017 09:50 AM

    if you change "fail the test" to "Generate Error" on false condition, it will continue looping the data set.



  • 3.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 28, 2017 09:55 AM

    Thanks Annalakshmi.

     

    Yes I have tried it, but there is one more problem in it.

     

    Assume that the test case that I have mentioned above is in a TEST SUITE and I am running the test suite locally.

     

    If I had set it to "GENERATE ERROR", then on Test suite results(in <machineName>:1507/devtest/#/login), it is showing the step status as "PASS".

     

    On generating an error, should I not say "Fail" in results?



  • 4.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 28, 2017 09:56 AM

    Thanks Annalakshmi.

     

    Yes I have tried it, but there is one more problem in it.

     

    Assume that the test case that I have mentioned above is in a TEST SUITE and I am running the test suite locally.

     

    If I had set it to "GENERATE ERROR", then on Test suite results(in <machineName>:1507/devtest/#/login), it is showing the step status as "PASS".

     

    On generating an error, should I not say "Fail" in results?



  • 5.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 28, 2017 12:40 PM

    Yes Santoz, Generate Error will not make the test case as Fail on the report screen. Even i want to show them as Fail and proceed with next and have not figured out the solution !!

    How to customize test results status and reports structure in DevTest-reporting section.. 



  • 6.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 29, 2017 02:10 AM

    Thanks AnnaRamadoss. Keep this thread posted, if you get any updates.



  • 7.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 30, 2017 02:05 PM

    I believe you can add 'Fail Test Case' companion to your test case to achieve Failed status if any errors have been generated during the test run.

    It's also mentioned in the official documentation:

    Fail Test Case Companion - DevTest Solutions - 10.0 - CA Technologies Documentation 



  • 8.  Re: DATA SET looping even on Assertion Failure

    Posted Mar 30, 2017 02:27 PM

    this companion shows the Failed status on the overall test case status screen, not at the fictional test/scenario level. 

     

     

    but i would like to see the status as Fail at the test run level

     



  • 9.  Re: DATA SET looping even on Assertion Failure
    Best Answer

    Posted Apr 03, 2017 04:40 PM

    Santoz There is a workaround for this that will involve coding.

    When your assertion will fail, make it navigate to a java script step where you can set a property for overall test result as fail. In the end of the entire execution, have a do-nothing step with scripted assertion to test if overall test result is "pass" or "fail". return false if it is fail and Fail the entire Test case. Customize logs as per requirement.

     

    Hope that will help. 

     

    P.S. let me know if need any help in script.

     

    Thanks,

    Monika