Forum Discussion
PrathapR
5 years agoFrequent Contributor
Is it possible to use "Request" instead of "RawRequest" in your case?, I tried your code to remove "" for null using "Request" it worked for me.
EX:
def rawRequest = testRunner.testCase.getTestStepByName("GetREST").getPropertyValue("Request")
def content = rawRequest.replaceAll("\"null\"", "null")
- gsvkumar5 years agoNew Contributor
Tried Request instead of RawRequest and that doesnt work either..
- gsvkumar5 years agoNew Contributor
The code snippet is doing the replace properly but when the actual test step is executed, the replaced value is NOT fed into the submitted request.
- richie5 years agoCommunity HeroHey gsvkumar,
If youre struggling to get the event handler to sort it (even though from what youve described id expect it to successfully convert the text null into wellformed null datatype), you could import into a Properties step and change the datatype that way?
I appreciate this is far less efficient than using events as youd need to do this for each testcase that has a wellformed null in there, but it would work.
Ta
Rich
Related Content
Recent Discussions
- 14 hours ago
- 17 days ago