简体   繁体   English

如何从groovy脚本中设置SOAPUI JDBC请求步骤的连接字符串?

[英]How do you set SOAPUI JDBC Request step's Connection String from a groovy script?

I would post this on soapui forums but they won't let me register & don't display any errored field colorings =-= 我会将其发布在soapui论坛上,但它们不会让我注册并且不会显示任何错误的字段着色=-=

without finding it in the documentation, i'm walking blind 没有在文档中找到它,我就瞎了

I've tried this so far, no dice: 到目前为止,我已经尝试过了,没有骰子:

def project = testRunner.testCase.testSuite.project
def db = project.getPropertyValue("dbConnectionString")
testRunner.testCase.testSteps["JDBC Request"].setPropertyValue("Connection String", db)
log.info "db connection string set to "+ db

after much confusion & jumping through objects because the JdbcTestRequest wasn't visible in the soapui documentation overview.... found the object in question: https://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/teststeps/JdbcRequestTestStep.html 经过大量混乱并跳过对象,因为在soapui文档概述中看不到JdbcTestRequest。...找到了有问题的对象: https ://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl /teststeps/JdbcRequestTestStep.html

answer to this is 答案是

testRunner.testCase.testSteps["getOfferNames"].setConnectionString(db)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM