在SOAPUI中使用Groovy执行JDBC测试步骤 [英] Execute JDBC teststep using Groovy in SOAPUI
问题描述
def Proj = null
def workspace = testRunner我试图在SOAPUI中使用Groovy执行JDBC teststep .testCase.testSuite.project.getWorkspace();
PROJ = workspace.getProjectByName( <项目名> 中)
DEF ProjTestCase = Proj.testSuites [ [ < TestSuiteName> 中]测试用例[。
将TestCaseName>中]
DEF DBTestStep = ProjTestCase.getTestStepByName( Get_10_DBValues)
DEF转轮= NULL
转轮= DBTestStep.run(TestRunner的,上下文)
log.info(DBTestStep)
runner = null
我给出以下输出
INFO:com.eviware.soapui .impl.wsdl.teststeps.JdbcRequestTestStep @ 7f34840b
参照您的评论,
由于您Groovy脚本是内项目> testsuite> testCase,你不能在外部单独触发你的groovy脚本
但是,你可以只启用你的groovy脚本并禁用所有其他测试步骤
当你运行project / testcase时, groovy将会执行并显式调用其他步骤。SOAPUI不会自行运行被禁用的步骤。
I am trying to execute JDBC teststep using Groovy in SOAPUI
def Proj = null
def workspace = testRunner.testCase.testSuite.project.getWorkspace();
Proj= workspace.getProjectByName("<ProjectName>")
def ProjTestCase = Proj.testSuites["["<TestSuiteName>"].testCases["
<TestCaseName>"]
def DBTestStep = ProjTestCase.getTestStepByName("Get_10_DBValues")
def runner = null
runner = DBTestStep.run(testRunner, context)
log.info(DBTestStep)
runner = null
I gives me following output INFO:com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep@7f34840b
Referring to your comment, Since your groovy script is within the project>testsuite>testCase, you cannot trigger your groovy script alone, externally. However, you can enable only your groovy script and disable all other test steps. When you run the project/testcase, your groovy will execute and call other steps explicitly. SOAPUI will not run disabled steps by its own.
这篇关于在SOAPUI中使用Groovy执行JDBC测试步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!