Forum Discussion
Andrew_H
14 years agoOccasional Contributor
Thanks Henrik!
That helps. Which now brings me to a new issue. So far then I have the groovy data source described above to randomly select a XML file from a directory. Then I have the XML data source which defines the XPath of the value that I want to get from the XML file. What I want to do is get the entire <Applicant> section, tags and all, so my XPath would be MyMessage/Applicant/* , however this doesnt work, and nothing is returned when I run this. The only thing that works is if I use a XPath value that points to a single value. How do I transfer the entire <Applicant> section, tags at all into the property where I could insert that block of XML into a new test request?
My XML looks like this:
<MyMessage>
<Advert>
.
.
.
.
</Advert>
<Applicant>
<Name>${DataGen#FName} ${DataGen#LName}</Name>
<Email>${DataGen#FName}.${DataGen#LName}@test.com</Email>
<ApplicationTime>2011-02-16T20:49:39Z</ApplicationTime>
<ChannelId>careerbuilder</ChannelId>
<Rank>Unranked</Rank>
<Doc DocumentType="Body" EncodingType="Base64">${ApplicantData#Applicant}</Doc>
</Applicant>
</MyMessage>
That helps. Which now brings me to a new issue. So far then I have the groovy data source described above to randomly select a XML file from a directory. Then I have the XML data source which defines the XPath of the value that I want to get from the XML file. What I want to do is get the entire <Applicant> section, tags and all, so my XPath would be MyMessage/Applicant/* , however this doesnt work, and nothing is returned when I run this. The only thing that works is if I use a XPath value that points to a single value. How do I transfer the entire <Applicant> section, tags at all into the property where I could insert that block of XML into a new test request?
My XML looks like this:
<MyMessage>
<Advert>
.
.
.
.
</Advert>
<Applicant>
<Name>${DataGen#FName} ${DataGen#LName}</Name>
<Email>${DataGen#FName}.${DataGen#LName}@test.com</Email>
<ApplicationTime>2011-02-16T20:49:39Z</ApplicationTime>
<ChannelId>careerbuilder</ChannelId>
<Rank>Unranked</Rank>
<Doc DocumentType="Body" EncodingType="Base64">${ApplicantData#Applicant}</Doc>
</Applicant>
</MyMessage>