Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My Groovy Script Fails to Pick Up XML Element Value

 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have prepared a Groovy script in soapUI. Somehow, the Groovy script fails to get XML element value; specifically, I always pick up the default file (i.e., FILE_FOUND_RESP). Whenever there is an exception (for example, document unique ID is ILLEGAL) the default file is still selected but not the ILLEGAL_RESP file. I am seeking help to find out my mistakes. Thank you very much in advance.

Here is my Groovy script in soapUI.


This Groovy script is supposed to read through a XML file (shown below) and get the value of the element <DocumentUniqueId>:
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the XPath is correct? What value does the documentId hold?
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done some tests by specifying each of the response files as the default response. They all work as expected.

Now, I believe the problem is the XPATH. However, I just cannot see the mistake. If anybody could help to see the XPATH, I would greatly appreciate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic