Contributions
Previously working test no longer works...
Hi! I have been asked to run a ReadyAPI test that was last run about a year ago. I am now getting this groovy error when I try to run it: startup failed: Script3.groovy: 1: Unexpected input: '\' @ line 1, column 86. eDateFormat; use(TimeCategory)\u007B new ^ org.codehaus.groovy.syntax.SyntaxException: Unexpected input: '\' @ line 1, column 86. at org.apache.groovy.parser.antlr4.AstBuilder$1.syntaxError(AstBuilder.java:4597) at groovyjarjarantlr4.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:44) at groovyjarjarantlr4.v4.runtime.Parser.notifyErrorListeners(Parser.java:543) at groovyjarjarantlr4.v4.runtime.DefaultErrorStrategy.notifyErrorListeners(DefaultErrorStrategy.java:154) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.reportInputMismatch(DescriptiveErrorStrategy.java:103) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recover(DescriptiveErrorStrategy.java:55) at org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy.recoverInline(DescriptiveErrorStrategy.java:68) at groovyjarjarantlr4.v4.runtime.Parser.match(Parser.java:213) at org.apache.groovy.parser.antlr4.GroovyParser.compilationUnit(GroovyParser.java:362) at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(AstBuilder.java:405) at org.apache.groovy.parser.antlr4.AstBuilder.buildCST(AstBuilder.java:384) at org.apache.groovy.parser.antlr4.AstBuilder.buildAST(AstBuilder.java:424) at org.apache.groovy.parser.antlr4.Antlr4ParserPlugin.buildAST(Antlr4ParserPlugin.java:58) at org.codehaus.groovy.control.SourceUnit.buildAST(SourceUnit.java:257) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) at org.codehaus.groovy.control.CompilationUnit.buildASTs(CompilationUnit.java:666) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:632) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at groovy.lang.GroovyShell.parse(GroovyShell.java:538) at groovy.lang.GroovyShell.parse(GroovyShell.java:570) at groovy.lang.GroovyShell.parse(GroovyShell.java:565) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.recompileWithNewName(SoapUIGroovyScriptEngine.java:151) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:142) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:91) at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:83) at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.doEval(EvalPropertyResolver.java:161) at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.resolveProperty(EvalPropertyResolver.java:149) at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:213) at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:221) at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:156) at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:152) at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expandProperties(PropertyExpander.java:135) at com.eviware.soapui.impl.wsdl.submit.filters.PropertyExpansionRequestFilter.filterAbstractHttpRequest(PropertyExpansionRequestFilter.java:48) at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:34) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.filterRequest(HttpClientRequestTransport.java:420) at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:196) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:130) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832) 1 error I get this error when it tries to evaluate this: ${=import groovy.time.TimeCategory; import java.text.SimpleDateFormat; use(TimeCategory)\u007B new SimpleDateFormat("yyyy/MM/dd").format(new Date("${#Project#birthDate0an}") - 58.year)\u007D} The code in question is put in a custom project property and birthDate0an exists and it is correctly initialized. Now as far as I can see the parsing of the groovy code fails at the "\u007B" (right curly bracket code in Unicode). Now I tried to replace "\u007B" by "{" and "\u007D" by "}" and it did not work so it looks like the inner curly brackets must be escaped. The only thing I can think could have changed between now and 1 year ago when that test was last run is the version of ReadyAPI. What can I do to make this test work again? Thank you and have a nice day! NickSolved1.8KViews0likes5CommentsRe: Any way to create a unique id to send in soapUI requests?
Hi and thank you! M McDonald wrote: Can you use a UUID, like 13619c78-1907-47f0-a169-6879a4c2cba0? Unfortunately the UUID is too long, the string we pass to that web service must be 17 characters long, no more, no less... M McDonald wrote: Thread index can be accessed with context.ThreadIndex We got an error message that said the context didn't exist when we tried to retrieve it (even though the edit screen said the context is supposed to be accessible). We're not using the latest version though (my guess is the people who made this test were afraid to upgrade the tool fearing the test might stop working), we're using Soap UI Pro 2.5.1 even though we're entitled to use the latest version. Thank you and have a nice day! Nick9.8KViews0likes0CommentsAny way to create a unique id to send in soapUI requests?
Hi! (I am not the actual user of soapUI at my work place, I am sending this to try to help a colleague which is working on a fairly thing schedule...) We're currently trying to generate a unique id to communicate with a web service we need to test and we can't seem to generate something unique enough to do load testing. We're currently using the current date and time (down to the milliseconds) to generate a string that we pass to the web service. Unfortunately, for our needs (we're doing a load test), it's still not unique enough. We saw an example (using a regular groovy script but we're using a DataGen one...) that used the "thread index" to make the id more unique. Unfortunately even though there's a notice on the screen that says that the context should be available in the script using we don't seem to be able to access it. How can we access the thread index from a Datagen script? Thank you! Nick PS: We actually have Soap UI pro if that makes any difference...11KViews0likes4Comments