Removing brackets [ ] from excel when added from soapui response using Groovy..
Hi,
Can someone please help!. I want to remove the brackets [ text] and just leave text when reading soapui response. My intended code in Groovy:
......
//read response from xml
def resholder = groovyUtils.getXmlHolder(reqOperationName+"#Response")
resTagValue1 = resholder.getNodeValues("//*:Isrn")
//write response value in xls
Label resTagValue1 new Label(2, Row, resTagValue1.toString());
Sheet1.addCell(resTagValue1);
....
When the value of resTagValue1 written into .xls, it showing as: [text] or [12344]. I would like them to be showing as: text or 12344
Any suggestions on how the brackets [ ] can be removed?.
Thanks in advanced..
getNodeValues returns an array of values so you could change that to getNodeValue for a single value
https://mytestingguide.wordpress.com/2013/05/06/soap-ui-json-groovy-scripts/
getNodeValue(xpath) returns a value of node specified by XPath expression
getNodeValues(xpath) returns an array of values specified by XPath expression