Contributions
create groovyteststep from groovy script
Hi All, Here I am trying to create groovy test step using groovy code: WsdlTestCase newTestCase = testRunner.testCase.testSuite.project.testSuites["RegressionTestSuite"].addNewTestCase("${p_TestCaseId}") TestStepConfig config2 = com.eviware.soapui.impl.wsdl.teststeps.GroovyScriptStepFactory.createNewTestStep( newTestCase, "myGroovy"); On executing - I am getting error: ERROR:groovy.lang.MissingPropertyException: No such property: com for class: Script11 what is wrong here. why this error? Regards, Ashish971Views0likes0CommentsRe: How to read Request log from groovy
Thanks Tim for your reply. Yes, my main purpose as of now is to get the response time for analysis. your suggestion 1: log.info("Response Time :" + messageExchange.getTimeTaken()) Some how this is not working for me even though I am using import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStepResult; suggestion 2: Yes you are right, this is the way we can access logArea, but again it doesn't work on "Request log" where as it works fine for "soapui log" "http log" ...... etc I mean all the bottom log tab. It seems that "request log" is not defined under logArea or SOAPUI log monitor Though, I can read the response time from "soapui log" but it has so many other information as well, that it takes quite an effort to extract the response time. If I can get where "Request log" is defined or how to get this log area, then it will simplify my task. If its seen on the UI then it must be defined somewhere. I just need this forums help to find out Thanks again. Ashish2.9KViews0likes0CommentsRe: Loading definition error
well I am also using the same version but I didn't have much luck I still see the problem as mentioned above. for the first time it didn't work, but immediately second time it works but again third time it didn't work ... and so on Here is what all I am doing.... 1. From groovy script : Loading the wsdl in to the project -- At this point I am getting the error I am clueless what's going wrong... Regards, Ashish12 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.3KViews0likes0Commentshow to add wsdl request to testcase as teststep
Helo, From groovy script I doing this: WsdlTestRequestStep addRequest(testCase, request, 1); But I am getting this error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script41.groovy: 35: unexpected token: 1 @ line 35, column 51. addRequest(testCase, request, 1); ^ org.codehaus.groovy.syntax.SyntaxException: unexpected token: 1 @ line 35, column 51. at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:139) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:107) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:163) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:839) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:544) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at groovy.lang.GroovyShell.parse(GroovyShell.java:770) at groovy.lang.GroovyShell.parse(GroovyShell.java:761) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: Script41.groovy:35:51: unexpected token: 1 at org.codehaus.groovy.antlr.parser.GroovyRecognizer.parameterDeclaration(GroovyRecognizer.java:8369) at org.codehaus.groovy.antlr.parser.GroovyRecognizer.parameterDeclarationList(GroovyRecognizer.java:7405) at org.codehaus.groovy.antlr.parser.GroovyRecognizer.variableDefinitions(GroovyRecognizer.java:2311) at org.codehaus.groovy.antlr.parser.GroovyRecognizer.declaration(GroovyRecognizer.java:2165) at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1208) at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:757) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:130) ... 20 more 1 error Any suggestion, on what should I use or what is going wrong? Please let me know if you need ay further information. import com.eviware.soapui.impl.*; import com.eviware.soapui.support.action.support.*; import com.eviware.soapui.impl.wsdl.WsdlInterface; import com.eviware.soapui.impl.WsdlInterfaceFactory; //import com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation; //import com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse; import com.eviware.soapui.impl.wsdl.WsdlRequest import com.eviware.soapui.impl.wsdl.WsdlOperation import com.eviware.soapui.impl.wsdl.actions.request.AddRequestToTestCaseAction import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase String wsdl = "mywsdl"; def project = testRunner.testCase.getTestSuite().getProject(); WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project, wsdl, true)[0]; // get desired operation WsdlOperation operation = (WsdlOperation) iface.getOperationByName( "My request" ); // create a new empty request for that operation WsdlRequest request = operation.addNewRequest( "My request" ); // generate the request content from the schema request.setRequestContent( operation.createRequest( true ) ); def position = 1 //Add request to the test case def testCase = testRunner.testCase.testSuite.getTestCaseList() //testRunner.getTestCase().name; log.info("${testCase}"); WsdlTestRequestStep addRequest(testCase, request, 1); Thanks in advance for your help. -Ashish980Views0likes1CommentGenerate Mock service from groovy script
Hi ALL, Please find below how to generate mock service from SOAPUI groovy script - import com.eviware.soapui.impl.wsdl.WsdlProject import com.eviware.soapui.impl.wsdl.mock.WsdlMockService def project_name = testRunner.testCase.testSuite.project.name def my_mock = createMockService("$project_name") If you know the alternate method. please let me know. Thanks, Ashish1.2KViews0likes2CommentsIs this a short coming of SOAPUI?
Hi, I found that when ever we are dealing with SSL, then we have to do the SSL settings in the Preference and then we have to RESTART SOAPUI. and then have to generate a MOCK SERVICE a fresh. The point is - if you are doing the automation where you are dealing with different certificate and you are required to do these changes on the runtime. then I thik it is a very very difficaultto do this - well reason is that I don't know how to Generate the MockService from the Groovy scripts. for me its shortcoming of SOAPUI. If not then Please let me know how to do so? I tried with createMockservice() but didn't succeed. Any help in this regards is greatly appreciated. Thanks in advance. Ashish.814Views0likes0CommentsRe: Difference- Port in Mockservices vs Mock Port in SSL settin?
Hi, could you please let me know what type of certificate does SOAPUI accepts? Is there something do with the extension Like in this site it is shown as ".keystore "? Looking forward to your response. Regards, Ashish2.9KViews0likes0Comments