Is there any code (Java, for example) that creates a file in .xml format and saves it in a folder? I can't find... I've searched in several places, but to no success. =//
Thanks in advance!
CodePudding user response:
To my knowledge, there aren't any out of box features in JMeter to process XML. You can use Groovy XML objects/operations to read/write XML
CodePudding user response:
Have you really tried to search? There is an official documentation for Java, i.e. check Writing Out a DOM as an XML File guide
Also be aware that there is no Java support in JMeter (unless you decide to develop your own plugin) and it's recommended to use Groovy for scripting so it might be a better idea to look for code to copy and paste in Groovy documentation. A quote from the above page:
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.records() {
car(name: 'HSV Maloo', make: 'Holden', year: 2006) {
country('Australia')
record(type: 'speed', 'Production Pickup Truck with speed of 271kph')
}
car(name: 'Royale', make: 'Bugatti', year: 1931) {
country('France')
record(type: 'price', 'Most Valuable Car at $15 million')
}
}
def records = new XmlSlurper().parseText(writer.toString())
