jkrier
7 years agoRegular Contributor
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...
- 7 years ago
I think you're after a "request" from these:
public static final String AMF_REQUEST_TYPE "amfrequest" public static final String DELAY_TYPE "delay" public static final String GOTO_TYPE "goto" public static final String GROOVY_TYPE "groovy" public static final String HTTPREQUEST_TYPE "httprequest" public static final String JDBC_TYPE "jdbc" public static final String JMS_STEP_ID "JMS" public static final String MANUAL_TEST_STEP "manualTestStep" public static final String PROPERTIES_TYPE "properties" public static final String TRANSFER_TYPE "transfer" public static final String RESTREQUEST_TYPE "restrequest" public static final String RUNTESTCASE_TYPE "calltestcase" public static final String MOCK_RESPONSE_TYPE "mockresponse" public static final String REQUEST_TYPE "request"
I got that from this page and section https://www.soapui.org/apidocs/constant-values.htl#com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory.GROOVY_TYPE
But to be honest I never would have found that without looking through the source code.
It looks like if you try creating it from just the type, you're going to get prompted every time for which Operation the request is going to be on. So you'll need to figure out how to call addTestStep and pass in the rest of the information it needs. (One idea: what about cloning an existing test step?)