CrazyFrog
9 years agoContributor
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);
}