Get the system Ip

well, show us the code of this particular testcase you wrote.
i have the feeling you are using the advice provided up to now in a dumb manner.
you cannot use that url directly but wrote a dedicated method to retrieve it and use it further

Yes its described about two types IPs when we ping certain services,

we provided to you some code snippets.
which works
the issue is, how do you assemble them?

String dynamicIP = WebUI.comment(getSystemIP())

WebUI.callTestCase(findTestCase(‘AdminUI/Commons/Login’), [(‘username’) : GlobalVariable.service, (‘password’) : GlobalVariable.S_pwd],


WebUI.callTestCase(findTestCase(‘AdminUI/Commons/Create Area’), [(‘areaname’) : ‘TestingArea’], FailureHandling.STOP_ON_FAILURE)

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/a_Devices’))

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/a_Create new device’))

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/span_No item selected’))‘Object Repository/Edit Widget/Page_AdminClient/span_TestingArea’))

WebUI.setText(findTestObject(‘Object Repository/Edit Widget/Page_AdminClient/input_Name_deviceName’), ‘TestDevice’)


WebUI.setText(findTestObject(‘Object Repository/Edit Widget/Page_AdminClient/input_IP address_deviceIp’), dynamicIP)

WebUI.delay(0.5)‘Devices/Page_AdminClient/button_Create new device’))

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/a_Widgets’))

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/a_Create new widget’))

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/span_No item selected’))‘Object Repository/Edit Widget/Page_AdminClient/span_TestingArea’))

WebUI.setText(findTestObject(‘Object Repository/Edit Widget/Page_AdminClient/input_Name_widgetName’), ‘Testwidget’)

WebUI.selectOptionByValue(findTestObject(‘Object Repository/Edit Widget/Page_AdminClient/select_DocumentContainerWebFrameMediaApp To_5069c4’),
‘number:4’, true)

WebUI.delay(0.5)‘Object Repository/Edit Widget/Page_AdminClient/input_Set as start screen for device_widgetDevice’))‘Object Repository/Edit Widget/Page_AdminClient/input__btn btn-success’))


WebUI.callTestCase(findTestCase(‘AdminUI/Commons/Log out’), [:], FailureHandling.STOP_ON_FAILURE)

not_run: WebUI.closeBrowser()

String getSystemIP() {
String host = ‘

URL url = new URL(host)

URLConnection conn = url.openConnection()

conn.setRequestProperty('accept-language', 'en-US,en;q=0.9')

conn.setRequestProperty('user-agent', 'MyJavaApp')


InputStream ins = conn.getInputStream()

InputStreamReader isr = new InputStreamReader(ins, 'utf-8')

BufferedReader websiteText = new BufferedReader(isr)

String line = null

StringBuilder sb = new StringBuilder()

while ((line = websiteText.readLine()) != null) {



return sb.toString()


1 Like

Here device in the sense, its system dynamic port IP

1 Like

would you mind to propper format your post so the code can be readable?
I am tired to repeat this each and every time, dig onto the forum how do do that.
until then i will just ignore further posts on this topic

Uploading: 2023-09-17_22h13_00.png…

1 Like

To have your code format better, put 3 backticks ( like ```) on a line by itself above your code and another 3 backticks on a line by itself below your code, like below.


This message tells us that you ran the script on a machine which has no immediate network connection to the Internet.

Why no connection to the Internet? It depends on the network configuration you have. Nobody, other than you yourself, can see it.

I guess, your machine is located in a private network which is indirectly connected to the Internet only through a Proxy server. You need to configure Katalon Studio with the ip address and port# of the Proxy.

If you are running the script inside Katalon Studio GUI on your local PC, you need to configure Preferences > Katalon > Proxy > System:

If you are running the script inside Katalon Runtime Engine on a remote server, you need to specify the proxy address & port# as a part of the command line options:

If @deepaveerappa.kadrol sits behind the organizational Proxy server, the will respond the public IP of the Proxy server which is exposed to the Internet. It does not respond the “local IP” of his PC on the organizational private network.

If @deepaveerappa.kadrol wants to see the “local IP” of his Windows PC on his organizational private network, then just use ipconfig command provided by Windows.

You can execute any OS command from Katalon test cases:

Or, using pure Java;


Going back to your original post:

Still I do not see what “system Ip” you mean. Please define it more clearly. Please describe how your machine is connected to the Internet. Without knowing your network configuration, the word “system Ip” does not make any sense to others on the forum.

How do you expect this to work?
That line does what it says.
Will post a comment on the console and on the report.
Will not assign the returned IP value to the variable, but a certain object from the WebUI class.
Which, most likely, is not a string so will conflict with the declared type.

I examined this.

The dynamicIP is substitued with null as WebUI.comment() is declared void.

WebUI.comment() returns nothing. So Groovy substitues null to the dynamicIP.

You were intrigued also, isn’t it?
That was also my lucky guess …
Anyway, the OP code is a mess, and we don’t have the full traceback of the error, so we cannot explain fully what is happening.
From my side, I will no longer reply to this topic.
Simply, nothing matches …
The error is between the chair and the keyboard.

I wasn’t really intrigued.
The statement

String dynamicIP = WebUI.comment(getSystemIP())

was the very 1st line of his code.
It was obvious for me that this statement is invalid.
It was easy for me to examine this single statement to prove that I am right.

I mean, intrigued by the topic.
Once the code was properly formatted, that was obvious for me also.

Ah, yes.

I only looked at the code which @grylion54 kindly formatted.

Similar discussion a year ago:

where @bionel contributed a lot.

1 Like

InetAddress i =


dynamicIp = i.getHostAddress()

WebUI.setText(findTestObject(‘Object Repository/Edit Widget/Page_AdminClient/input_IP address_deviceIp’), dynamicIp)


This solution has worked for me, Thank You to this wonderful community

1 Like

2023-09-19 07:12:19.125 DEBUG testcase.Start screen device_setup - 13: i = InetAddress.getLocalHost()
2023-09-19 07:12:19.188 DEBUG testcase.Start screen device_setup - 14: out.println(i.getHostAddress())