ok. This is my requirement , what I did and what I'm trying to do. I'm running 100s of test case against an api which helps me in testing registration form having multiple which includes Firstname, lastname , account number etc in different permutations and values like capturing the error json by passing empty entry for Firstname in one case, then passing empty account number for other request and capturing the different json response. The good part with WM is it records each of this permutation and stores the stub which is very good. The point that complicates thing is, this request form is sending the request body as string and has an entry that is dynamically generated. So even though I use the same value for forms with same set of permutations (always same) this dynamic entry in request body(request body is string) is making the replay fail.
Now what i did in temporary basis:- I used Responsetransformer to parse the request body and write several if else conditions to check what fields state like are they empty /valid to provide appropriate response. This is so hard to maintain the logic as registration has several pages forms and I have to run several permutation and combinations in my test case to capture the response.Once I complete my recording I get around 2000 stubs. This one single dynamic value in the body makes everything difficult, both record and play and also in maintaining the logic.
What I'm trying to do now:-
1. As mentioned- looking for option to edit the request body before storing the stub. In this way I can implement regex to accept the request just by ignoring that specific dynamic string. Editing each stub with regex after recording is time consuming.
2. The other way I'm thinking is, write a global request transformer that someway gets the recorded request body and newly incoming request body then do some parsing to check if the new and recorded are same except the dynamic filed. In this case I do not know how to pass the recorded request body.
Can second point achievable with current set-up?.