cancel
Showing results for 
Search instead for 
Did you mean: 

Adding ResponseSLAAssertion using Java and SoapUI API

CrazyFrog
Contributor

Adding ResponseSLAAssertion using Java and SoapUI API

Hello

I write my own testautomation script in java using SoapUI API.
For adding a XPathAssersion i wrote the method below.

My Question is: How can i add a ResponseSLAAssertion to a teststep
Does anyone have an example or the solustion for me.

Thanks

CrazyFrog


public static void
addXPathAssertion(WsdlTestStep testStep,String assertName, String xpath, String expectedResult)
{
TestAssertion assertion = ((WsdlTestRequestStep)testStep).addAssertion((new Factory()).getAssertionLabel());
((XPathContainsAssertion)assertion).setIgnoreNamespaceDifferences(true);
((XPathContainsAssertion)assertion).setIgnoreComments(true);
((XPathContainsAssertion)assertion).setAllowWildcards(true);
((XPathContainsAssertion)assertion).setName(assertName);
((XPathContainsAssertion)assertion).setExpectedContent(expectedResult);
((XPathContainsAssertion)assertion).setPath(xpath);
}

 

1 REPLY 1
nmrao
Community Hero

Re: Adding ResponseSLAAssertion using Java and SoapUI API

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors