加拿大30秒

Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
您的位置: Linux安全网 > Linux集群 > Architecture > » 正文

soapUI LoadTest

来源: 未知 分享至:
import com.eviware.soapui.model.testsuite.Assertable
import com.eviware.soapui.impl.wsdl.teststeps.*


//////////////////////////////////////////////////

log.info "start run tastcase driver to setup.html' target='_blank'>setup new wapid"
def testCaseDriver = loadTestRunner.loadTest.testCase.testSuite.getTestCaseByName("Driver")
log.info "HERE"
log.info testCaseDriver.getLabel()
def propertiesDriver = new com.eviware.soapui.support.types.StringToObjectMap ()
def async = false
testCaseDriver.run (propertiesDriver, async)
def output = testCaseDriver.getPropertyValue("wapId")
log.info "Output: " + output
loadTestRunner.loadTest.testCase.setPropertyValue("wapId", output)
log.info "Here"




//////////////////////////////////////////////////



log.info "HERE"
def testCase = loadTestRunner.loadTest.testCase.testSuite.getTestCaseByName("TestCase")
log.info "HERE"
log.info testCase.getLabel()
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
//def async = false
//testCase.run (properties, async)

def testRunner = testCase.run( null, false )

//http://www.soapui.org/apidocs/
//def project = context.testCase.testSuite.project

//def testSuite = project.getTestSuiteAt(1)//project testsuite 0-->WAPLOAD 1-->TempTest


//def testCase = loadTestRunner.loadTest.testCase.testSuite.getTestCaseByName("TestCase")
//def testCase = testSuite.getTestCaseByName("TestCase")

def props = new java.util.Properties();
props = testRunner.testCase.getTestStepByName("udp");


def random=(int)(Math.random()*10)
log.info("random udp "+random)

def randomUDP = props.getPropertyValue(random.toString() );//"2");


log.info(randomUDP)


// set property value
testCase.setPropertyValue( "randomUDP", randomUDP )
testCase.setPropertyValue( "UDP ID", random.toString() )
//object.properties["name"].value = "value"

// get property value
//log.info testCase.getPropertValue("randomUDP")
//log.info object.properties["name"].value
//log.info object.properties."name".value




//for( testCaseT in testSuite.getTestCaseList() ) {
log.info("test Case : ["+ testCase.getLabel()+"]")
for( testStep in testCase.getTestStepList() ) {

//if( testStep instanceof WsdlTestRequestStep ) {

log.info (testCase.getLabel()+"------->"+"testStep"+testStep.getLabel() )
/* testStep.getTestRequest()
.setUsername(testSuite
.getPropertyValue("basicAuthUser"))
testStep.getTestRequest()
.setPassword(testSuite
.getPropertyValue("basicAuthPass"))*/
// }
}
//}
log.info "start..."
//log.info "${udpJson.1}"

def outputFinal = testCase.getPropertyValue("wapId")
log.info "Output: " + outputFinal
//loadTestRunner.loadTest.testCase.setPropertyValue("wapId", output)
log.info "done"






Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
加拿大30秒相关的文章列表:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史