automated testing - drive all test parameters (including http verb) from excel sheet
Hello,
I'm trying to standup automated testing capability for APIs using ReadyAPI (soapUI, etc.). for the sake of speed, I need to be able to drive all request (REST request) parameters from excel sheet including the http verb. I did manage to get everything as a parameter from the excel sheet even assertions but I couldn't drive the http verb/method (POST, GET, PUT, & DELETE) from the excelsheet.
My ultimate goal is to have a 4 step generic test case
dataSourceLogin (Excel login)
loginRequest
dataSourceLoopLogin
dataSourceScenarios (Excel)
request (POST, GET, PUT or DELETE)
dataSourceScenarios Loop
As per the above, the test QA analyst after developing the test scenarios, all he/she needs to do is to just fill in a row for every scenario or multiple row for a complex scenario.
After a chat with one of SmartBear engineers, he confirmed that it is impossible to do that as this is how it was designed. Now I'm in a very difficult situation as I'm half way through and I'm stuck. He said that different requests with different verbs have different composition.
I was thinking to do the below workaround but I need some help:
Thanks Richie,
I gave it a go and came up with the above which working perfectly fine with a simple event groovy script. I even created a The whole project which also got tons of other automated features can be downloaded from here https://earth2.digital/GenericProject-readyapi-project.xml
The project has simple 2 test cases:
1. To authenticate and get a token
2. Execute test cases by getting all parameters from a grid (can be modified to get from excel sheet). When I release v2 I will have it reading from an excel sheet.
Here is the Event groovy script:
// Check if the current test step is ScenarioDataSource
if ( testStepResult.getTestStep().getName().equals("Start")) {
if (context.expand( '${ScenarioDataSource#method}').equals("POST")) {
testRunner.gotoStepByName( "POSTRequest")
} else if (context.expand( '${ScenarioDataSource#method}').equals("GET")) {
testRunner.gotoStepByName( "GETRequest")
} else if (context.expand( '${ScenarioDataSource#method}').equals("PUT")) {
testRunner.gotoStepByName( "PUTRequest")
} else if (context.expand( '${ScenarioDataSource#method}').equals("DELETE")) {
testRunner.gotoStepByName( "DELETERequest")
}
} else if ( testStepResult.getTestStep().getName().equals("POSTRequest") ||
testStepResult.getTestStep().getName().equals("GETRequest") ||
testStepResult.getTestStep().getName().equals("PUTRequest") ||
testStepResult.getTestStep().getName().equals("DELETERequest") ) {
// Run the first test step in the loop
testRunner.gotoStepByName( "ScenarioDataSourceLoop")
//log.info ( "ScenarioDataSourceLoop" )
}Hi richie
I have published the framework with lots of details on Github. Please have a look and let me if addresses your concern about complex cases.
All you need to do is to fill in the excel sheet for your test scenario.
Github Repo: https://github.com/earth2digital/automated-api-ddt-framework
LinkedIn Article: https://www.linkedin.com/pulse/how-boost-performance-your-apis-part-i-adam-ali-/
My blog Article: https://www.earth2.digital/blog/How-to-boost-the-performance-of-your-APIs-1-adam-ali.html
Cheers,
adam