This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A way to exit the test execution. | |
1.Creating one second delay step in the end of test case and jumping to that step by using testRunner.gotoStepByName(); | |
2.Creating one dummy groovy step in the end of test case and jumping to that step by using testRunner.gotoStepByName(); | |
3.Using testRunner.Cancel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${#TestCase#ResquestID} | |
${#TestSuite#ResquestID} | |
${#Project#ResquestID} | |
${#EnV#ResquestID} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def java_home = context.expand('${#Env#JAVA_HOME}'); | |
log.info java_home |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Use test Case level timeout feature | |
2. Use test case level maintain HTTP session feature | |
3. Allways implement Some time out mechanism : | |
-Max Time out | |
-Max Number of retried (With fixed retry duration or increasing or decreasing retry duration) | |
4. Do not repeat any HTTP step | |
insted testRunner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set SOAPUI_HOME=C:\DevTools\soapui\SoapUI-Pro-5.0.0 | |
call %SOAPUI_HOME%\bin\testrunner.bat -sUnitTesting -f Project1-soapui-project.xml | |
call %SOAPUI_HOME%\bin\testrunner.bat -sUnitTesting2 -f Project1-soapui-project.xml | |
call %SOAPUI_HOME%\bin\testrunner.bat -sotherTests -f Project2-soapui-project.xml | |
call %SOAPUI_HOME%\bin\testrunner.bat -sotherTests2 -f Project2-soapui-project.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dont Use Enviornments: Use Groovy +Peroperties Step Combination | |
Dont Use Envents: Manually Add headers like cookies to each step | |
Dont Use Data Source Step for Looping: Use Goovy Looping logic | |
So what you need to know: | |
You must be good or intermediate level coding skills in groovy | |
You must be familier with SOAPUI API and Its Methods to use. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Setting mock request headers | |
mockRequest.httpResponse.setHeader('MyHeader', "HiThere;") | |
mockRequest.httpResponse.setContentLength(456) | |
mockRequest.httpResponse.sendError(404) | |
//Setting response properties | |
def resp = mockOperation.getMockResponseByName('MyResponse') | |
resp.setResponseHttpStatus(202) | |
return 'MyResponse' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample XML: | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<sam:loginResponse> | |
<sessionid>10873286937963711</sessionid> | |
</sam:loginResponse> | |
</soapenv:Body> | |
</soapenv:Envelope> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.eviware.soapui.model.testsuite.TestRunner.Status | |
Running Specific Step in another Test Suite | |
def project = testRunner.testCase.testSuite.project | |
testRunner.runTestStep( project.testSuites['TESTSUITE1'].testCases['TESTCASE1'].testSteps['TESTSTEP6'] ) | |
testRunner.runTestStep( project.testSuites['TESTSUITE1'].testCases['TESTCASE2'].testSteps['TESTSTEP8'] ) | |
// get TestCase | |
def tc = testRunner.testCase.testSuite.project.testSuites["Sample Simple TestSuite"].testCases["TestCase Name"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Date Time Stamp: | |
import java.text.*; | |
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy_MM_dd_HHmmss"); | |
SimpleDateFormat startDate = new SimpleDateFormat("MM/dd/yyyy"); | |
Date now = new Date(); | |
String strDate = sdfDate.format(now); | |
Date date = new Date(); | |
String startDate1 = startDate.format (date) | |
Date prevDay = new Date()-1; |