0

I have a testcase, where I need to make GET requests in a loop. I'm using RequestSpecification to prepare request, and then make it. I pass new URI in each request in the loop. And I have discovered that RequestSpecification object saves queryParameters with every request. I don't need old queryParameters. How I can clear old queryParameters?

Here is a screenshot like I have old queryParameters for new request.

enter image description here

Igor Vlasuyk
  • 514
  • 2
  • 10
  • 22

1 Answers1

1

inside loop, before next GET request made clear the previous query param

public void clearQueryParam(RequestSpecification requestSpecification) {

        FilterableRequestSpecification filterableRequestSpecification = (FilterableRequestSpecification) requestSpecification;
    
        filterableRequestSpecification.removeQueryParam("codes");
    }