Contributions
Re: Modularize the soapui test suites: Groovy script in eclipse, create a jar file & call it into soapUI
When I add a main method to the above code I am getting another error. Please help me to sort out the best way to deal with this task. Caught: groovy.lang.MissingMethodException: No signature of method: static com.qwertyqw.main() is applicable for argument types: ([Ljava.lang.String; ) values: [[]] Possible solutions: main([Ljava.lang.String; ), wait(), wait(long), any(), find(), wait(long, int) groovy.lang.MissingMethodException: No signature of method: static com.swsim.demo.CreateEnvelopeIndicium.main() is applicable for argument types: ([Ljava.lang.String; ) values: [[]] Possible solutions: main([Ljava.lang.String; ), wait(), wait(long), any(), find(), wait(long, int)6 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.1KViews0likes1CommentModularize the soapui test suites: Groovy script in eclipse, create a jar file & call it into soapUI
0 down vote favorite I need to create a sample Soap request by calling the endpoint URL and give the necessary login and password info and then send a request and get a response in XML. I'm writing the groovy script in eclipse IDE and creating a jar file and call that jar file into SoapUI and call the code within the jar file into SoapUI. I am getting an error and how should I resolve this? Is there any other way to achieve my goal? Please help me. The Output: Caught: groovy.lang.GroovyRuntimeException: This script or class could not be run. It should either: - have a main method, - be a JUnit test or extend GroovyTestCase, - implement the Runnable interface, - or be compatible with a registered script runner. Known runners: * org.apache.groovy.plugin.DefaultRunners$Junit3TestRunner * org.apache.groovy.plugin.DefaultRunners$Junit3SuiteRunner * org.apache.groovy.plugin.DefaultRunners$Junit4TestRunner Here is the code: package com.xyz.demo class ABC { public setUP() { // set data def url = new URL("https://qwertywq.asmx").openConnection(); if(soapaction != null) connection.setRequestProperty("SOAPAction", soapaction); connection.setRequestProperty("Content-Type", "Text/xml"); String AuthorizationString = "Basic " + (username + ":" + password).bytes.encodeBase64(); connection.setRequestProperty("Authorization", authorizationString); OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream()); wr.write(xml); wr.close(); // Get the response String response; InputStream responseStream; try { responseStream = connection.getInputStream(); success = 1; } catch( IOException e ) { success = 0; if( connection.getResponseCode() == 500 ) { responseStream = connection.getErrorStream(); } else throw e; } response = responseStream.getText("utf-8"); responseStream.close(); return response; }6 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.2KViews0likes2Comments