Setup proxy manually

Hi,

Running Katalon 5.4 on ubuntu behind a proxy.
Katalon download is automated, now facing proxy issue while running a test suite.
How can I modify the proxy setting manually ?

Thanks

Katalon Studio’s Console Mode execution (https://docs.katalon.com/display/KD/Console+Mode+Execution) enables you to specify proxy.server.address and proxy.server.port as command line arguments. Does it meet your requirement?

Or do you want to modify the proxy setting for Katalon Studio by your Test Case (or Test Suite) script on the fly? I do not think it is possible. You can read the proxy setting by calling com.kms.katalon.core.configuration.RunConfiguration#getProxyInformation()
(https://api-docs.katalon.com/studio/v4.6.0/api/com.kms.katalon.core/com/kms/katalon/core/configuration/RunConfiguration.html#getProxyInformation() ) but it does NOT provide any method to modify the proxy settings on the fly.

One day I have encountered a similar issue regarding proxy :


I have not yet reached any favorable solution for this issue.

One possible design I could dream of is introducing new signature to WebUI.openBrowser method so that it accept a custome proxy setup. For example, in a Test Case I would have:

import org.apache.http.HttpHost
import org.apache.http.client.config.RequestConfig...RequestConfig rc = createProxyConfig()WebUI.openBrowser('https://kazurayam1.xxxxxxxx@hub-cloud.browserstack.com/wd/hub', rc)...private RequestConfig createProxyConfig() {  HttpHost proxy = new HttpHost('127.0.0.1', 8080, 'http')  RequestConfig config = RequestConfig.custom()    .setProxy(proxy)    .build()  return config}

This is just an idea. We do not have this yet.

3 Likes

You can use below code at script level if you want to give proxy

System.getProperties().put(“http.proxyHost”, “****”);

System.getProperties().put(“http.proxyPort”, “**”);

Regards,
Rajesh Rapolu