cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Remote Address value in SoapUI?

SOLVED
Highlighted
Contributor

How to get Remote Address value in SoapUI?

As we know, one domain may how more instance Servers (with different IPs) to handle requests, and all requests are assigned by Load Balance. Now I have a scenario need to get the instance server machine ip (which showed as "Remote Address"  property in Chrome Dev Tools View) in SoapUI,  how to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

Re: How to get Remote Address value in SoapUI?

I got your problem. But, Not sure about how to replicate this problem. Anyway, You can use Java servlet code. method name is getRemoteAddr() to fetch it.

 

There are plenty of links in google.

6 REPLIES 6
Super Contributor

Re: How to get Remote Address value in SoapUI?

I hope this code can help you out:-

def httpResponseHeaders = context.testCase.testSteps["Request_ Name"].testRequest.response.responseHeaders
def st = httpResponseHeaders.entrySet().getAt(0).getValue() //In this case Remote address is at 0th position, you can change it based on your header result
log.info st
Contributor

Re: How to get Remote Address value in SoapUI?

Thanks for your response, but it's not works for me. Looks the "Remote Address" most likely Request property but not Response propery, I did run the code as your solution, but the Response did not give any IP here. And My Response As Below: HTTP/1.1 200 OK Date: Tue, 21 May 2019 09:47:11 GMT Content-Type: image/gif Content-Length: 43 Connection: close Set-Cookie: _id=abcd; expires=Thu, 20-May-21 09:47:11 GMT; path=/ P3P: policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID" Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate,no-transform,max-age=0 Pragma: no-cache Expires: 0 X-Frame-Options: ALLOW-FROM GIF89a
Super Contributor

Re: How to get Remote Address value in SoapUI?

In the screenshot which you have attached earlier, Remote Address Key is there. So, I gave solution based on that. Now, in the response, you are not getting that header key.

HTTP/1.1 200 OK 
Date: Tue, 21 May 2019 09:47:11 GMT 
Content-Type: image/gif 
Content-Length: 43 
Connection: close 
Set-Cookie: _id=abcd; expires=Thu, 20-May-21 09:47:11 GMT; path=/ 
P3P: policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID" 
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate,no-transform,max-age=0 Pragma: no-cache Expires: 0 X-Frame-Options: ALLOW-FROM GIF89a

So, How I am gonna check the Remote Address key out of it?

Contributor

Re: How to get Remote Address value in SoapUI?

I get the "Remote Address" from Chrome Developer Mode but not SoapUI, you can have a try with Chrome: Steps like: 1.Open Chrome and Press [Ctrl + Shift + I], go to "Network - XHR" Tab 2.visite any site (https://cn.bing.com/?ensearch=1&FORM=BEHPTB) and check Request parameters 3.you can find Remote Address here. NOTE: I can get Remote Address with Chrome, now I want to get this value with SoapUI, that's what I want
Super Contributor

Re: How to get Remote Address value in SoapUI?

I got your problem. But, Not sure about how to replicate this problem. Anyway, You can use Java servlet code. method name is getRemoteAddr() to fetch it.

 

There are plenty of links in google.

Contributor

Re: How to get Remote Address value in SoapUI?

Thanks for your advice, I will try.

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win