Some tips about SoapUI project
2017-02-27 00:00
288 查看
摘要: 开发SoapUI项目中的一些小经验
1. Test Project and Test Suite name cannot contain blank space.
This will cause many TestSuites error if the project was built on Jenkins.
2. Post body in HTTP request cannot contain charactor '&' .
If it contains '&', the HTTP response will return error information :
3. Post body in HTTP request cannot contain charactor '%' .
If it contains '%', the HTTP response will return error information :
4. Get active environment via groovy script :
log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
5. Set active environment via groovy script :
testRunner.testCase.testSuite.project.setActiveEnvironment("Live")
6. Get current project's workspace path: ${projectDir} .
The property has been invoked.
7. Get one TestStep's response:
def response = testRunner.testCase.testSteps["InitCase"].testRequest.response.contentAsString
def response = context.expand('${InitCase#Response}')
def response = messageExchange.getResponseContent()
8. Set TestStep's request headers:
def headerMap = new StringToStringMap()
headerMap.put("X-API-UserId",'${#Project#X-API-UserId}')
headerMap.put("Accept-Encoding", "deflate")
testRunner.testCase.testSteps["InitCase"].testRequest.setRequestHeaders(headerMap)
9. Set property value into TestSuite:
testRunner.testCase.testSuite.setPropertyValue(propertyName, propertyValue)
That's the same logic for setting property value into TestStep and Project.
10. Get TestStep list of one TestRequest type:
testRunner.testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.class)
Test Step Type有一下几种:
HttpTestRequestStep
JdbcRequestTestStep
ManualTestStep
RestTestRequestStep
WsdlDelayTestStep
WsdlGotoTestStep
WsdlGroovyScriptTestStep
WsdlMockResponseTestStep
WsdlPropertiesTestStep
WsdlRunTestCaseTestStep
WsdlTestRequestStep
WsdlTestStep
11. Goto one TestStep by Name :
testRunner.gotoStepByName("TestStepName")
1. Test Project and Test Suite name cannot contain blank space.
This will cause many TestSuites error if the project was built on Jenkins.
2. Post body in HTTP request cannot contain charactor '&' .
If it contains '&', the HTTP response will return error information :
3. Post body in HTTP request cannot contain charactor '%' .
If it contains '%', the HTTP response will return error information :
4. Get active environment via groovy script :
log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
5. Set active environment via groovy script :
testRunner.testCase.testSuite.project.setActiveEnvironment("Live")
6. Get current project's workspace path: ${projectDir} .
The property has been invoked.
7. Get one TestStep's response:
def response = testRunner.testCase.testSteps["InitCase"].testRequest.response.contentAsString
def response = context.expand('${InitCase#Response}')
def response = messageExchange.getResponseContent()
8. Set TestStep's request headers:
def headerMap = new StringToStringMap()
headerMap.put("X-API-UserId",'${#Project#X-API-UserId}')
headerMap.put("Accept-Encoding", "deflate")
testRunner.testCase.testSteps["InitCase"].testRequest.setRequestHeaders(headerMap)
9. Set property value into TestSuite:
testRunner.testCase.testSuite.setPropertyValue(propertyName, propertyValue)
That's the same logic for setting property value into TestStep and Project.
10. Get TestStep list of one TestRequest type:
testRunner.testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.class)
Test Step Type有一下几种:
HttpTestRequestStep
JdbcRequestTestStep
ManualTestStep
RestTestRequestStep
WsdlDelayTestStep
WsdlGotoTestStep
WsdlGroovyScriptTestStep
WsdlMockResponseTestStep
WsdlPropertiesTestStep
WsdlRunTestCaseTestStep
WsdlTestRequestStep
WsdlTestStep
11. Goto one TestStep by Name :
testRunner.gotoStepByName("TestStepName")
相关文章推荐
- some tips about python
- some tips about python One
- Some tips about how to reverse Array with C#
- Some Tips About Layout Resource
- Some thought about current project
- Some Tips About C++
- Some tips about Control Flow in Python
- Some tips about python
- CodeProject-Some Cool Tips For .Net 之一
- some tips about python Two
- Some tips about the life cycle of Maya thread pool
- Some Tips and Tricks about Qt
- About GNIT some tips
- Some tips about the C++(自己看的,很乱)
- Some Tips and Tricks about Qt
- some tips about python default value....
- some tips about python Three
- Share some tips about android develop(一)
- some tips about python Four
- some tips about python Six