Contributions
Re: XmlSlurper/XmlParser to store data from HTML content
Hello, Indeed, you have a good point in terms of the raw content. There are some parsing issues. The problem is that the URI is based on dynamic data which I should store at each call of this step (for further processing), so it is not possible to just define a text that I will only get the (static) value. Any ideas how to approach this?7.2KViews0likes0CommentsRe: XmlSlurper/XmlParser to store data from HTML content
As a matter of fact, this is the displayed content via XML view. However, I also provide the content of the Raw view (below): HTTP/1.1 201 Created Date: Wed, 14 Feb 2018 12:49:42 GMT Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Content-Type-Options: nosniff X-Frame-Options: DENY X-XSS-Protection: 1; mode=block Location: URI Content-Type: text/html;charset=UTF-8 Content-Length: 383 Connection: close <!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"><html><head><title>201 Created</title></head><body><h1>TGT Created</h1><form action="URI" method="POST">Service:<input type="text" name="service" value=""><br><input type="submit" value="Submit"></form></body></html> Do you believe that any escaping may be involved?7.2KViews0likes0CommentsRe: XmlSlurper/XmlParser to store data from HTML content
Hello Paul, You were right, thank you for the feedback. The test step name was misspelled. I corrected and adapted the script to the following format: import groovy.util.XmlSlurper; def response = messageExchange.response.responseContent; def slurper = new XmlSlurper(); def xmldata = slurper.parseText response; However,I hit a different issue: The public identifier must begin with either a single or double quote character. Should the content be parsed in a different manner?7.3KViews0likes1CommentXmlSlurper/XmlParser to store data from HTML content
Hello, I am a new user of SoapUI community version (5.0.0). I need to store theaction value from the (HTML) response (below): <html> <head> <meta content="HTML Tidy for Java (vers. 26 sept. 2004), see www.w3.org" name="generator"/> <title>201 Created</title> </head> <body> <h1>TGT Created</h1> <form method="post" action="URI"> Service: <input value="" name="service" type="text"/> <br/> <input value="Submit" type="submit"/> </form> </body> </html> I am trying to use Groovy to finally get this value (through XmlSlurper or XmlParser) using the following declarations (to parse the context) through Script assertion (on the same step): import groovy.util.XmlSlurper; def response = context.expand( '${Login#Response}' ).toString(); def slurper = new XmlSlurper(); def xmldata = slurper.parseText response; .. but i get "Premature end of file". Could someone provide some information about this problem? Thank you in advanceSolved7.7KViews0likes12Comments