Skip to main content
Version: current

Set Proxy Preferences in Katalon Studio

From Katalon Studio version 7.5.0 onwards, the proxy is divided into two categories: Authentication and System proxies. You can apply different proxy configurations for connecting to the Katalon server and your servers during testing.

You need to go to Katalon Studio > Preferences > Katalon > Proxy and select the Authentication or System section for the corresponding proxy configuration of each type.

The proxy configurations in Authentication Proxy section are used when connecting and authenticating to Katalon servers. This affects account authentication, Katalon TestOps, TestCloud, Store integration, the Katalon auto-updater, WebDriver auto-updater, sample projects providers, and more.

System proxy configurations are applied to all network connections generated when using Katalon Studio, including but not limited to recording, spying, executing tests, integrating with other tools, and downloading Web Drivers or Android SDK.

In the Proxy Settings areas of both Authentication and System proxies, you can select one of the three options below.proxy option

  • No proxy: Connect directly without proxy.
  • Use system proxy configuration: Katalon Studio guesses which proxy server your system is behind by checking Java, browser and operating system settings, and environment variables.
  • Manual proxy configuration: you can manually set up your proxy with the following settings:

    • Address: an HTTP Proxy host.
    • Port: an HTTP Proxy port.
    • Excludes: A list of addresses separated by comma to exclude. The ability to exclude proxy is available from version 7.2.0 onwards. Katalon Studio only supports proxy exceptions in web recorder and spy utilities with Chrome and Firefox.

System proxy for the desired capabilities of a test execution

Katalon Studio applies the system proxy to the desired capabilities of a test execution on the instance automatically. If you wish to configure different proxy settings depending on your projects, you can use desired capabilities as follows:

  1. Open your project and go to Katalon Studio > Preferences > Katalon > Proxy > System.
  2. At the bottom of the displayed view, uncheck the Auto-apply to test execution desired capabilities option.

  3. Click Apply to save.

    desire capabilities for system preference

  4. Go to Project > Settings > Desired Capabilities and select a testing environment.

  5. Specify proxy details and click Apply to save.

    For example:

    use proxy for desired capabilities

Override proxy details in the test script

From version 7.0.0 onwards, Katalon Studio supports an option to pass proxy details via a request object in Web Service testing. Below is an example:
RequestObject requestObject = findTestObject("google")
ProxyInformation proxyInfo = new ProxyInformation();
proxyInfo.setProxyServerAddress("localhost")
proxyInfo.setProxyServerPort(8001)
proxyInfo.setProxyOption(ProxyOption.MANUAL_CONFIG.toString())
proxyInfo.setProxyServerType(ProxyServerType.HTTP.toString())
requestObject.setProxy(proxyInfo)
Note:
  • The proxy information passed in the request object takes precedence over the proxy information set in Preferences.

Another workaround to override proxy details in script mode is to get your current proxy format, then pass your new proxy information in. You can refer to the example below:

Override Proxy details workaround

import com.google.gson.Gson 
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.network.ProxyInformation
import com.kms.katalon.core.network.ProxyOption

// Get current proxy information
ProxyInformation proxy = RunConfiguration.getProxyInformation()
println(proxy)

// Switch proxy
proxy.setProxyOption(ProxyOption.MANUAL_CONFIG.name())
proxy.setProxyServerAddress("127.0.0.1")
proxy.setProxyServerPort(8082)
Map<String, Object> generalProperties = RunConfiguration.getExecutionGeneralProperties();
generalProperties.put(RunConfiguration.PROXY_PROPERTY, new Gson().toJson(proxy));
println proxy

// Switch back to no_proxy
proxy.setProxyOption(ProxyOption.NO_PROXY.name())
proxy.setProxyServerAddress("")
proxy.setProxyServerPort(0)
Map<String, Object> generalProperties = RunConfiguration.getExecutionGeneralProperties(); generalProperties.put(RunConfiguration.PROXY_PROPERTY, new Gson().toJson(proxy));

println proxy

See also: