Ask a Question

Cleaning data in security test

RJanecek
Regular Contributor

Cleaning data in security test

Hi, how I can add some clean script after each request which was made by security scan ? Each request add to my database some data and when I didnt clean data other requests end with fault

thx
5 REPLIES 5
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi!

hmm.. I think you would have to create a SecurityTestRunListener.afterSecurityScanRequest handler that would manually submit the desired request for cleaning up.. does that sound like a good option?

regards!

/Ole
SmartBear Software

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
RJanecek
Regular Contributor

hm this sounds very hard. Can you show me some tutorial how I can create this ?
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi,

sure.. do as follows;

1) Prepare the request you want to submit to clear the data as a standard request under the corresponding operation/interface in your project
2) Add a SecurityTestRunListener.afterSecurityScanRequest handler to your project (in the project window), with the following content:

// get the request
def request = testRunner.testCase.testSuite.project.interfaces["your interface"].operations["your operation"].getRequestByName( "your request" )

// submit it and wait for it to finish
request.submit( null, false )


Does that work ok?

regards!

/Ole
SmartBear Software

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
RJanecek
Regular Contributor

and whereI can found SecurityTestRunListener.afterSecurityScanRequest handler in my project ? whe should I click or something
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi!

Click on the project node and go to the events tab - you can read more about handlers at http://soapui.org/Scripting-Properties/ ... dlers.html

regards,

/Ole
SmartBear Software

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: