Forum Discussion
PrathapR
Frequent 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")
gsvkumar
5 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- gsvkumar5 years agoNew Contributor
Could you please explain more on "you could import into a Properties step and change the datatype that way?"..
I could'nt follow what you are suggesting..
Related Content
- 7 years ago
Recent Discussions
- 8 days ago