Forum Discussion

Vallish_Shankar's avatar
Vallish_Shankar
Occasional Contributor
16 years ago

How to add a new Xpath Match assertion in Java

Hello:

I am having a bit of trouble setting the content for the xpath match assertion.

I have the following so far.

WsdlOperation operation = (WsdlOperation) iface.getOperationByName(operationName);
WsdlTestCase tc = testSuite.addNewTestCase("TestCase");
TestStepConfig config = WsdlTestRequestStepFactory.createConfig(operation, "TestStep1");
WsdlTestRequestStep ts = (WsdlTestRequestStep) tc.addTestStep(config);
TestAssertion ta = ts.addAssertion( "XPath Match" );

I need to set the xpath expression to:
declare namespace ns='http://www.somecompany.com;
//code='123'

How do I set the expression in the TestAssertion? I did not find any methods to do this.

Thanks much!