Forum Discussion
smoothe19
12 years agoNew Contributor
Hi I resolved my own issue after 3 days lol...
Incase anyone else encounters the xml pragma being stripped here is what i did to the groovy..
Incase anyone else encounters the xml pragma being stripped here is what i did to the groovy..
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder("InvoiceTestRequest1#request")
Random r = new Random()
def refnum = r.nextInt(999999)
while (refnum < 100000) {
refnum = r.nextInt(999999)
}
def cor = r.nextInt(999999)
while (cor < 100000) {
cor = r.nextInt(999999)
}
def mes = r.nextInt(999999)
while (mes < 100000) {
mes = r.nextInt(999999)
}
holder.setNodeValue( "//Header/MessageId" , "LoadTest"+mes);
holder.setNodeValue( "//Header/CorrelationId" , "LoadTest"+cor);
holder.setNodeValue( "//Invoice/InvoiceHeader/InvoiceReferences/PurchaseOrderReference/PurchaseOrderNumber/Reference/RefNum" , "LoadTest"+ refnum);
def input = '<?xml version="1.0" encoding="UTF-8"?> ' + holder.xml;
//holder.updateProperty()
testRunner.getTestCase().getTestStepByName("InvoiceTestRequest1").getProperty('Request').setValue(input)
//context.requestContent = input