ContributionsMost RecentMost LikesSolutionsRe: Can't invoke external groovy script with test case variables So, I added a new Groovy step and called the external script using the same way I was in my example and it worked. I made no changes to any of the code and the original Groovy step still fails and the new one works. They are identical. I didn't want anyone to waster their time looking at this. Maybe it's a bug for Smartbear. Can't invoke external groovy script with test case variables I have an external script that I want to use to store values in for a JDBC query request. I am getting the following error groovy.lang.MissingMethodException: No signature of method: library.getAccount.GetAccount.ab_complete_newconnect_retail() is applicable for argument types: (org.apache.log4j.Logger, com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext, com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner) values: [org.apache.log4j.Logger@15b10f62, [ThreadIndex:0, log:org.apache.log4j.Logger@15b10f62, ...], ...] error at line: 2 I have other external scripts that I call the same way (far as I can tell) and they work without issue. Here is the script I am trying to invoke package library.getAccount class GetAccount { def account( log, context, testRunner ) { def inputs = [ beam_number_in :'', customer_type_in :'', device_platform_id_in :'4', device_status_id_in :'2', device_type_id_in :'', ext_svc_agreement_ref_seq_in :'0', external_transaction_refseq_in :'0', facade_owner_in :'PROVISIONING', fcd_transaction_status_id_in :'3', fcd_transaction_type_in :'add', from_date_in :'5', rate_name_in :'', sales_channel_id_in :'', sales_channel_type_id_in :'1', satellite_name_in :'', state_in :'', to_date_in :'0', transaction_status_id_in :'6', transaction_type_in :'new', zip_in :'', ] for ( item in inputs ) { log.info item.key + ' : ' + item.value testRunner.testCase.testSteps[ 'Properties' ].setPropertyValue(item.key, item.value) } } } And I am invoking it with this script def setGetAccountInputs = new GetAccount() setGetAccountInputs = setGetAccountInputs.account( log, context, testRunner ) I believe it's failing at the invoking script. It looks to me like SoapUI isn't recognizing the variables. Has anyone else seen this before and or am I calling the external script incorrectly? Re: Call stored procedure that's in a package in oracle So I was able to get a bit farther. It looks like I wasn't getting all the way to the proc and had to change the call to {call SCHEMA_NAME.PACKAGE_NAME.PROCEDURE_NAME('param1', 'param2', 'param3')} I am still getting an error 2018-04-20 15:23:45.000 - Error getting response; java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00801: internal error [22503] ORA-06550: line 1, column 7: PL/SQL: Statement ignored If I try this in sqldeveloper it returns Error starting at line : 1 in command - {call SIEBAS_OWNER.SIEBAS_APP.GET_BEAM_SERVICE(1)('Anik-F2-SB2', '5120 HIGHWAY 26 WEST', '', 'OKOLONA', 'AR', '71962', '9799', 'WB DIRECT')} Error report - Unknown Command So I'm guessing this is not the correct command. Call stored procedure that's in a package in oracle I'm trying to call a stored proc that is inside of a package. I can't seem to find much documentation around this anywhere. I have seen a few somewhat complicated groovy scripts but it seems like this should be available as a feature in SoapUI seeing as how they put a checkbox on the jdbc steps for doing this. The most straight forward example I have found is {call package_name('param1', 'param2', 'param3')} When I use this I get the error 2018-04-19 12:59:31.654 - Error getting response; java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier 'GET_BEAM_SERVICE' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored So I pulled the declare out of sqldeveloper DECLARE SATELLITE_NAME_IN VARCHAR2(32); ADDRESS_LINE1_IN VARCHAR2(80); ADDRESS_LINE2_IN VARCHAR2(80); CITY_IN VARCHAR2(80); STATE_CODE_IN VARCHAR2(2); ZIP_CODE_IN VARCHAR2(5); ZIP_4_IN VARCHAR2(4); SALES_CHANNEL_NAME_IN VARCHAR2(1024); BEAM_SVC_ADDR_REF_OUT APP.beam_service_refcur; BEGIN SATELLITE_NAME_IN := 'Sat-1'; ADDRESS_LINE1_IN := '512 HIGHWAY 26'; ADDRESS_LINE2_IN := ''; CITY_IN := 'OKOLONA'; STATE_CODE_IN := 'AR'; ZIP_CODE_IN := '71962'; ZIP_4_IN := '9799'; SALES_CHANNEL_NAME_IN := 'DIRECT'; APP.GET_BEAM_SERVICE( SATELLITE_NAME_IN => SATELLITE_NAME_IN, ADDRESS_LINE1_IN => ADDRESS_LINE1_IN, ADDRESS_LINE2_IN => ADDRESS_LINE2_IN, CITY_IN => CITY_IN, STATE_CODE_IN => STATE_CODE_IN, ZIP_CODE_IN => ZIP_CODE_IN, ZIP_4_IN => ZIP_4_IN, SALES_CHANNEL_NAME_IN => SALES_CHANNEL_NAME_IN, BEAM_SVC_ADDR_REF_OUT => BEAM_SVC_ADDR_REF_OUT ); /* Legacy output: DBMS_OUTPUT.PUT_LINE('BEAM_SVC_ADDR_REF_OUT = ' || BEAM_SVC_ADDR_REF_OUT); */ :BEAM_SVC_ADDR_REF_OUT := BEAM_SVC_ADDR_REF_OUT; --<-- Cursor --rollback; END; but when I run that I get the error 2018-04-19 13:17:10.562 - Error getting response; java.sql.SQLException: Missing IN or OUT parameter at index:: 1 SolvedRe: Creating TestCases and TestSteps dynamically in a Groovy step So I decided to try import com.eviware.soapui.config.TestStepConfig import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestStepFactory def suite = testRunner.testCase.testSuite def newTestCase = suite.addNewTestCase("NewTestCase") def newTestStep = newTestCase.addTestStep("request", "NewTestStep" ) I used REQUEST_TYPE because I had found some examples where people usedHTTPREQUEST_TYPE and PROPERTIES_TYPE That worked, kind of. It gave me a prompt to pick the operation. So then I tried doing something like this import com.eviware.soapui.config.TestStepConfig import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestStepFactory def suite = testRunner.testCase.testSuite def newTestCase = suite.addNewTestCase("NewTestCase") def newTestStep = newTestCase.addTestStep("request", "NewTestStep", "https://myendpoint.com", "myOperation") This created the new test case but without a test step, it threw no error. So I guess if you got any ideas, I need to pull in an existing operation from whatever interface it exists in. I'm going to look around and see if I can figure it out. If I do I will reply back to let you know. If you can help that would be great. Re: Creating TestCases and TestSteps dynamically in a Groovy step And to be even more of a pain. Those types are throwing an error Wed Mar 21 12:34:45 MDT 2018:ERROR:An error occurred [No such property: REQUEST_TYPE for class: Script3], see error log for details Wed Mar 21 12:35:06 MDT 2018:ERROR:An error occurred [No such property: PROPERTIES_TYPE for class: Script4], see error log for details Wed Mar 21 12:35:19 MDT 2018:ERROR:An error occurred [No such property: HTTPREQUEST_TYPE for class: Script5], see error log for details This is the code I am running, am i doing something wrong? import com.eviware.soapui.config.TestStepConfig import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestStepFactory def suite = testRunner.testCase.testSuite def newTestCase = suite.addNewTestCase("NewTestCase") def newTestStep = newTestCase.addTestStep(REQUEST_TYPE, "NewTestStep" ) Re: Creating TestCases and TestSteps dynamically in a Groovy step Yeah, I hear you. I am not happy with this either, to be honest. This is going to be our long term approach for building and automating tests. The problem is I need individual test cases for any iteration of a request. I can't really think of a better way to do this. While I have your attention; it looks like I will want to use public static final String REQUEST_TYPE "request" Do you have any ideas on how I can pull in an existing operation from an interface in the project? In the link I provided in my initial post I see WsdlTestStep addTestStep(Stringtype,Stringname,Stringendpoint,Stringmethod) do you think the "method" input can be used or am I misunderstanding it's purpose? Creating TestCases and TestSteps dynamically in a Groovy step We are trying to integrate with a project management software for test case development. We have a way of feeding the test results into this software so it will auto pass/fail the test case. Some of our test cases are just configuration, 10's, 100's, 1000's permutations of the same method. We want the test case names in SoapUI to be unique, representing the values that are being sent in the operation. The only way I can think of doing this without having to manually create hundreds of test cases is to create them with a groovy script, run them, and delete them. I found some code for creating a test case but no examples of adding a wsdl test step. import com.eviware.soapui.config.TestStepConfig import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestStepFactory def newTestCase = suite.addNewTestCase("NewTestCase") def newTestStep = newTestCase.addTestStep('testStep') The problem is the addTestStep() wants a type from what I can tell herehttps://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/testcase/WsdlTestCase.html I don't know what to put in the Stringtype. I've found examples of other test step types being created so I tried to kinda copy that structure and nothing is working. Also, I made the name of this thread a little off topic from the body because I am also interested if anyone has done this kind of thing before and maybe has a better solution or ideas. Thanks! SolvedRe: Retrieve binding properties/values with groovy script Hah!, I just realized you had it right actually. I started thinking about how I was going to use this unnamed variable and saw what I did wrong. String tns = testRunner.testCase.project.getInterfaceByName('ServiceActivationRouter') .getWsdlContext() .getDefinitionParts()[0] .getContent() .with { new XmlSlurper().parseText(it)} .with { definitions -> definitions.@targetNamespace.text() } log.info tns Re: Retrieve binding properties/values with groovy script I had to make a small change to actually log the namespace but this works. log.info testRunner.testCase.project.getInterfaceByName('ServiceActivationRouter') .getWsdlContext() .getDefinitionParts()[0] .getContent() .with { new XmlSlurper().parseText(it)} .with { definitions -> definitions.@targetNamespace.text() } Thanks for your help!