Testing back-end: automation approach for manual QA
Post on 12-Apr-2017
191 Views
Preview:
Transcript
Testing back-end: automation approach
for manual QCAlyona Tudan
QA Engineer at N-iX
What
Mobile application (front-end) Server side (back-end)
When
Time from summer 2015 Back-end: from 3 web-services to nearly 40 Front-end: from built-in option to standalone app
Why
Why
Why
Why
And much more…
Solution
Automation framework
Soap UI
Input data
Report
DDT Environment handling Resources handling Positive & negative
scenarios Assertions for every step Detailed reports CI Database checking
Schema
Login
Password
Back-end
Front-end
Request:
“Login”: “Login”,“Password”: “Password”
Response:
True
Challenges for manual QC
Writing down test suits with user journeys Full coverage of web-services Writing down asserting using groovy Scripting using groovy
How it looks
Input dataMain tab with test
cases
Tab of the test case with different
scenarios
Using variables
Using properties instead of exact values:
“ValueOfRequest”: “1234” (or “test”) “ValueOfRequest”: “${#TestCase#value}”
“Try” for possibility of empty variablesTry {
ID == null}
catch (Exception) {throw new RuntimeException ("There should be registered user");
}
Replacing text in request
def caseList = context.testCase.testSuite.getTestCaseList() caseList.each
{ def testStepList = it.getTestStepList();
testStepList.each {eachTestStep -> if(eachTestStep instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep){RestRequest request = eachTestStep.getHttpRequest();
def result = request.getRequestContent().replaceAll(“test", “NewTest"); request.setRequestContent(result) } } }
Turning on exact steps
def suitList = context.testCase.testSuite.project.getTestSuiteList()String env = context.testCase.testSuite.project.getPropertyValue("environment");suitList.each
{def caseList = it.getTestCaseList()caseList.each
{def testStepList = it.getTestStepList();
testStepList.each {
Turning on exact steps
if (env.equals ("PROXY")) {
if (it.name.equals( “LoginTest")){
it.setDisabled(true) }if (it.name.equals( “LoginProxy")){
it.setDisabled(false) }
log.info "Done PROXY"}
if (env.equals ("TEST")) {
if (it.name.equals( "LoginTest"))
{ it.setDisabled(false) }
if (it.name.equals("LoginProxy"))
{ it.setDisabled(true) }
log.info "Done TEST"}
DO not forget to close previous brackets }}}
Using loops
for(int i =0; i < 20; i++){def condition = context.testCase.getPropertyValue("Status");def code = context.testCase.getPropertyValue("Code");
if (code == "30") { break }else{testRunner.runTestStepByName("Delay") testRunner.runTestStepByName("GetCode")testRunner.runTestStepByName("JDBC: Check status")}}
One more loop for empty value
def condition = context.testCase.getPropertyValue("Id");
for (int i =0; i < 2; i++){ if (condition != ""){break}else{ testRunner.runTestStepByName("Delay") testRunner.runTestStepByName(“GetId")}}
Report
Conclusion
Time saving Running regression in 1 click Reports visibility Coverage Studying all the time Interest
Maintenance Merging troubles Review Studying all the time
Questions, ideas, feedback
Email: ymkocv@gmail.com Facebook: ymkocv Speakerdeck: ymkocv
top related