Forum Discussion

RJanecek's avatar
RJanecek
Regular Contributor
13 years ago

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

  • SmartBear_Suppo's avatar
    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
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    hm this sounds very hard. Can you show me some tutorial how I can create this ?
  • SmartBear_Suppo's avatar
    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
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    and whereI can found SecurityTestRunListener.afterSecurityScanRequest handler in my project ? whe should I click or something