Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

My Groovy Script Fails to Pick Up XML Element Value

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>:
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic