Service Virtualization

Expand all | Collapse all

How to mark the test case as failed based on web service response and execute next test case

  • 1.  How to mark the test case as failed based on web service response and execute next test case

    Posted 11-01-2017 06:18 PM
      |   view attached

    Hi All,

     

    I am testing a web service (SOAP) using application test . I have a set of input xml that i need to test against a web service endpoint . I use a File counter ( Numeric counting data set) , Read a file  and hit the web service. based on the web service response , I need to mark the test step/case as pass/fail . 

     

    I tired using a XML Xpath Assertion to capture the web service result , and then mark the test case as FAIL and then proceed to Next test case in the Counter. However, I am not able to achieve this . Either it marks all of them as PASS (even though the webservice returns false ), or it ends the test and does not go to next input. Please advise. Thanks



  • 2.  Re: How to mark the test case as failed based on web service response and execute next test case

    Posted 11-02-2017 08:40 AM

     if you are just looking to see failed iteration in ITR, use generate error in assertion options and next step would be continue with the loop. 

     

    Other option is branch out at assertion, one writes good r esponse , other branch generates error and failed response output, and both continue with the loop. 



  • 3.  Re: How to mark the test case as failed based on web service response and execute next test case

    Posted 11-02-2017 01:43 PM

    Hi AbhinavGMF, thanks for your response . Yes< I need the second option where I need the test to continue if each test case FAILS or PASSES and  capture the status in the Test Report. Currently , I am either getting all the test cases marked as PASS (even some of the test cases fail ) or If I add Fail the Test , it does not go to the loop and it end the test at that point. How do I branch out the assertion ? Can you please explain or provide more details on the steps ? Thanks



  • 4.  Re: How to mark the test case as failed based on web service response and execute next test case

    Posted 11-02-2017 02:29 PM

    1. add a companion. Fail Test Companion

    2. Instead of fail the test in assertion, change it to generate error.

     

    Once done, check if it matches your expectations

     

    Capturing test results in a detailed report requires adding couple of more test steps.

     

    You can follow below as your DevTest Framework for Test Case Design and automation.

     

    Header 1Header 2Header 3Header 4Header 5Header 6Header 7
    pass result saved
    create event listenerloop startsyour steps hereassertionfail result savedloop endsdelete listener


  • 5.  Re: How to mark the test case as failed based on web service response and execute next test case

    Posted 11-02-2017 06:59 PM

    Thanks again. I added the Fail Test Companion and have assert to error condition . But , it did not make a difference. Is there any thing else to be added , when we add this companion ? 



  • 6.  Re: How to mark the test case as failed based on web service response and execute next test case

    Posted 11-02-2017 08:25 PM

    You should see test case fail if any iteration fails and loop to continue on error provided there is loop.

     

    Are you not seeing it?

     

     

     

    Sent with Good (www.good.com)