Forum Discussion

Musaffir's avatar
Musaffir
Contributor
8 years ago
Solved

How to apply common assertions at Project or Suite Level

Hi,   I have a test suite in soapUi which has many test cases . And each test cases contains multiple REST requests tests steps as well. I would like to add assertions for all of those requests t...
  • Musaffir's avatar
    8 years ago

    One workaround that I have found is ,

    Write a groovy class with what ever assertions methods that you want to include , compile , make a jar of it and place to the {{..SmartBear\SoapUI-5.2.1\bin\ext}} folder of your soapui installation.

     

    Restart your soapui

     

    Go to the request step and add a script assertions, where import the groovy class and invoke the assertion method you have written, you may pass and context variable available like log, messageExchange etc ..

     

    If you have many request steps, this will still have to be added to each and every if those needs to be tested , but certainly avoid or reduce writing or adding same type of assertions manually to each and every request step.

     

    If you know any better approach , pls do let me know 

     

    Thanks

    Musaffir