Contact Us
About Us
News
Home
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome,
Guest
. Please
login
or
register
.
September 08, 2008, 05:21:16 am
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
How to read parent and child nodes in groovy?
Welcome,
Guest
. Please
login
or
register
.
September 08, 2008, 05:21:16 am
News:
The Forums are up! Welcome to eviware.
Eviware Forum
soapUI
soapUI
How to read parent and child nodes in groovy?
« previous
next »
Pages:
[
1
]
Author
Topic: How to read parent and child nodes in groovy? (Read 246 times)
Shashi
Newbie
Posts: 12
How to read parent and child nodes in groovy?
«
on:
May 06, 2008, 12:13:31 am »
Hello,
I have a response like this
<ax21:stageset>
<ax21:name>
<ax21:type>
</ax21:stageset>
<ax21:fabstageset>
<ax21:name>
<ax21:type>
</ax21:fabstageset>
Can some one please help me giving me leads to code the groovy assertion to get the child elements based on its parent?
Example, I need value of name under the first parent node that is ax21:stageset.
In my current script i am doing
def holder = groovyUtils.getXmlHolder( messageExchange.responseContent )
def name = holder.getNodeValue("//ax21:name")
this gets me the last one it reads. Is there a way to specify the parent.name like stageset.name or fabstageset.name?
Thanks in advance!
- Shashi
Logged
omatzura
Administrator
Hero Member
Posts: 1,210
Re: How to read parent and child nodes in groovy?
«
Reply #1 on:
May 06, 2008, 01:42:55 pm »
Hi Shashi,
please try the following instead;
def name = holder.getNodeValue("//ax21:stageset/ax21:name")
or
def name = holder.getNodeValue("//ax21:fabstageset/ax21:name")
regards!
/Ole
eviware.com
Logged
Shashi
Newbie
Posts: 12
Re: How to read parent and child nodes in groovy?
«
Reply #2 on:
May 06, 2008, 11:16:10 pm »
Thanks for the reply. It is working perfectly as expected.
- Shashi
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> eviware general
-----------------------------
soapUI
-----------------------------
=> soapUI
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.2
|
SMF © 2006-2007, Simple Machines LLC
Loading...