header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
January 09, 2009, 07:07:57 am
Username: Password:
Login with username, password and session length

Forgot your password?
 
How to add a new Xpath Match assertion in Java
Welcome, Guest. Please login or register.
January 09, 2009, 07:07:57 am
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  How to add a new Xpath Match assertion in Java
« previous next »
Pages: [1] Print
Author Topic: How to add a new Xpath Match assertion in Java  (Read 417 times)
Vallish Shankar
Newbie
*
Posts: 5


« on: July 22, 2008, 09:16:54 pm »

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!

Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #1 on: July 22, 2008, 11:16:51 pm »

Hi!

just cast the created TestAssertion to a XPathContainsAssertion, which has setters for the corresponding properties.

regards!

/Ole
eviware.com
Logged
Vallish Shankar
Newbie
*
Posts: 5


« Reply #2 on: July 25, 2008, 09:31:15 pm »

This works! Thanks much!
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header