Contributions
Re: Fetch cookies from soapUI Request and Response and reuse for following Requests
Hi Rao Before practicing your code, I would say appreciate very much. I feel I need to give you more details about my questions. My task is to use soapUI to test the API which is already deployed to test box. Before using soapUI, I have tried login from web browser, no matter FF or Chrome and open web development tool (click F12 as weknown). From the network tab showing, I can see the first method is login, which is Post method, then lots of Get methods and another Post method which is logevent. From that Post method, I can see the token Id. I thoughtI can use soapUIto do the same things. Am I right? I recon, thefirst step of request is login to the box, which should be a Post method. Yes it seems works and got http headers: Date Wed, 18 Nov 2015 20:08:32 GMT Transfer-Encoding chunked #status# HTTP/1.1 200 OK Expires Thu, 01 Jan 1970 00:00:00 GMT Keep-Alive timeout=10 Content-Type text/html;charset=UTF-8 Connection Keep-Alive X-Powered-By Servlet 2.5; JBoss-5.0/JBossWeb-2.1 X-Powered-By JSF/1.2 Pragma no-cache Cache-Control no-cache Cache-Control no-store But the size is quite different from what I got from web browser development tool Network tab showings. Why? This is my first question. Then I tried using groovy scripts and hope to get more details of Cookies but no luck so far. After the first step of login, I expect to use the soapUI request with Get method to test the API - to get the bundle of json data which the API should return. It works on web browser of course. But I am stuck on soapUI... I am wondering how to fetch the useful parameter from the first step and then HOW to re-use them to the following requests to test the API. This is my second question. Hope you can help? Thank you very much. Cheers swee9 years agoPlace ReadyAPI QuestionsReadyAPI Questions7.4KViews0likes1CommentFetch cookies from soapUI Request and Response and reuse for following Requests
Hi I have used follow script trying to get the cookies. def myClient = HttpClientSupport.getHttpClient() def myStore = myClient.getCookieStore() def cookieList = myStore.getCookies() log.info cookieList.size() It returned the zero of the size. But using this: def setCookie_resp = testRunner.testCase.testSteps["HTTP Request 1"].testRequest.response.getResponseHeaders() log.info setCookie_resp.size() log.info setCookie_resp["#status#"] It can get the size is same as the Headers on soapUI showing. But that size and real Cookie content is not same as the results got by browser developement tool. "HTTP Request 1" is the first request to login on the test box. Other question I would ask for the help. After successfully the first Request,which is Post for login, I expect to do the second Request to Get some json data, but it is never successful. Thanks very much if any expert can help! Cheers9 years agoPlace ReadyAPI QuestionsReadyAPI Questions7.4KViews0likes7CommentsRe: SoapUI Cookie management
It is great stuff although it was years ago. But the returned size is 09 years agoPlace ReadyAPI QuestionsReadyAPI Questions10KViews0likes2Comments