RequestFilter.filterRequest Script applied to only specific Test Cases
hello, I have a Project in SoapUI that contains lots of Test Cases. I have created a Event Handler Script to add a Header to the Rest Requests that uses the RequestFilter.filterRequest Event. My problem is I want to apply the Event script to ALL Test Cases that do not end in the words "- forbidden" (See photo below) How should I go about this problem? If I use the field 'Target' in the Event Handler? If so how do I filter using test cases names that end in "- forbidden"? If I try and include in the logic of the Event Handler to check if the Test Case name, I'm unable to access the TestRunner to access the test case name.Solved4.4KViews0likes5CommentsStructured logging of the results using EventHandler
Hi, Please navigate to the below path section 8 Logging results https://www.soapui.org/scripting-properties/tips-tricks.html#1-4-Test-step-name The code helps in creating the request and response files for each step but all of them get created in one location/folder Can someone help me in extending this to have the Project name , Suite name and the Test case names as folders ? Something like below Parent Folder : ProjectName_CurrentTimestamp Child Folder (Inside Parent Folder) : <TestSuitename> Child Folder (Inside Test suite Folder) : <TestCaseName> Here place all the request response files Actual code from the path provided above : filePath = 'c:/users/henrik/soapUI-results/' fos = new FileOutputStream( filePath + testStepResult.testStep.label + '.txt', true ) pw = new PrintWriter( fos ) testStepResult.writeTo( pw ) pw.close() fos.close() Basically i want a structured logging of the results.Solved4KViews0likes6CommentsHow to run code in OnStopTestCase section while executing the test from Keyword/Script test area?
Hi, I am trying to do some stuff at the end of my text execution, and writing that piece of code in OnStopTestCase event handler. But I noticed that this section is executed only when I am running my test from TestItems tab of my project. If I want to run my test from keyword tests or script tests, the control doesn't go to OnStopTestCase section. Do I need to do any setting for this to work? Can someone help? Thanks, PankhuriSolved1.2KViews0likes5Comments