Skip to content

Instantly share code, notes, and snippets.

View rajendrapenumalli's full-sized avatar
:octocat:
Comeon we can do anything

Rajendra Prasad Reddy Penumalli rajendrapenumalli

:octocat:
Comeon we can do anything
  • Bangalore
View GitHub Profile
@rajendrapenumalli
rajendrapenumalli / gist:bf2a656d00d86be670d5eba4f0fb940d
Created June 17, 2017 06:34
Implementing a way to exit from test execution loop
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
@rajendrapenumalli
rajendrapenumalli / gist:164064ec3ca93fdbfa697ca90267efa1
Created June 17, 2017 06:28
Setting parameters in SOAPUI request using a groovy script
${#TestCase#ResquestID}
${#TestSuite#ResquestID}
${#Project#ResquestID}
${#EnV#ResquestID}
@rajendrapenumalli
rajendrapenumalli / gist:e0e366a8c95b4af7f746686212c0fcac
Created June 17, 2017 06:18
Accessing SOAPUI Env Variables in Groovy Script Editors
def java_home = context.expand('${#Env#JAVA_HOME}');
log.info java_home
@rajendrapenumalli
rajendrapenumalli / gist:4ea38ff3241105e7304ecd4e5b2c7ceb
Last active June 17, 2017 05:52
Optimum Care While Creating Test Suite
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
@rajendrapenumalli
rajendrapenumalli / gist:f04457da438d47ed346baa382d8c687c
Created June 17, 2017 05:14
Running Multiple Test Projects via Batch file from Command Line Using testRunner
@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
@rajendrapenumalli
rajendrapenumalli / gist:8c3b2779d161265de162574b2b43845a
Created June 17, 2017 04:52
Creating Test Suite to work on both Open Source and Commercial Versions Of SOAPUI
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.
//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'
@rajendrapenumalli
rajendrapenumalli / Working with XAPATH in SOAPUI
Created February 1, 2017 01:50
Working with XAPATH in SOAPUI
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>
@rajendrapenumalli
rajendrapenumalli / SOAPUI -Running Specific Step in another Test Suite
Created January 30, 2017 04:34
SOAPUI -Running Specific Step in another Test Suite
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"]
@rajendrapenumalli
rajendrapenumalli / Date and Time Stamp String Generation In Groovy
Created January 30, 2017 04:32
Date and Time Stamp String Generation In Groovy
#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;