Forum Discussion

software_qa_eng's avatar
software_qa_eng
Occasional Contributor
15 years ago

rest response not updated in test case

I created a test case where i interface a selenium script using groovy script.

The selenium script adds an article to my content management system.

After i set the delay for 300000 ms, a rest request (json response) is made.

The problem is the response i see does not have the latest entry i added in my groovy script teststep. Not until i manually view the rest request and click the play button does the response update with the latest entry.

I have added extra delay time, with no avail.

here is the weird thing. When I retried this testcase, I make the same request on a browser during the delay teststep. i see the entry from the browser 150000ms during the delay countdown, yet the testcase request response is not updated. So i am wondering, is this a bug during the testcase run? possibly soapui caches the response?

I even tried adding the same rest request to see if the second request is updated, but that was pointless as well. any help would be appreciated.

4 Replies

  • software_qa_eng's avatar
    software_qa_eng
    Occasional Contributor
    I tried something outrageous and added another quick delay between the 1st and 2nd requests, it appears that did the trick.

    So I have found a workaround, but it means calling the same requests with a delay in between. I'd rather not have to do this cause it will add more time to the testcase.
  • Hi!

    that does sound very odd.. if you check the http log at the bottom of the soapUI window you will see the exact response that soapUI is receiving for your requests, to rule out any caching in soapUI. If that clears soapUI, then I wonder if it could be your server caching the response somehow? Or is there a proxy in between that might be doing the caching?

    regards,

    /Ole
    eviware.com
  • software_qa_eng's avatar
    software_qa_eng
    Occasional Contributor
    hmmm... i do get something in the http logs, which appears i am getting a response from the server.

    So the server I hit does cache. However, like I mentioned in my original post, while the delay counter is counting down, I open another browser on the same machine soapui is running on, and make the same rest request (same domain). On the browser, the response does return with the latest entry. Which means, once countdown reaches 0 and the rest request teststep is executed, the response should have the updated entry, but it does not.

    right now it's fine to add an extra request and delay, but it would be great not to have that extra overhead.
  • Hi!

    hmm.. does your request contain any custom HTTP Headers that might be making the server return a cached version?

    regards,

    /Ole
    eviware.com