Hello,
My Katalon test scripts run on a VM using a proxy.
- For KS, it is declared in Window \ Katalon Studio Preferences \ Katalon \ Proxy \ System:
Proxy option: Manual proxy configuration
Proxy server type: HTTP
Address: xxx, Port: yyy
- For KRE, my command-lines include: -proxy.system.option=MANUAL_CONFIG -proxy.system.server.type=HTTP -proxy.system.server.address=xxx -proxy.system.server.port=yyy
Now, when calling some very special REST API, I have to bypass this proxy.
I have tried two options (see below). None work. What am I doing wrong?
Option (a): Declare an exception
- In KS: Fill the text box for “Excludes” with “.subdomain.domain.com"
- In KRE: Add the -proxy.system.excludes=".subdomain.domain.com” option
It does not work. The “excludes” seems ignored. Does pattern matching work? I have tried with the full server name, it does not work.
Option (b): In the keyword which does the call to the REST API, override the default proxy stuff.
The code is:
// Get current proxy information KeywordUtil.logInfo("Proxy Info: "+ ro.getProxy()) // Override proxy ProxyInformation specialProxy = new ProxyInformation(); specialProxy.setProxyOption(ProxyOption.NO_PROXY.toString()) ro.setProxy(specialProxy) KeywordUtil.logInfo("Proxy Info FOR THIS REQUEST: "+ ro.getProxy()) //Send the request ResponseObject respObj = WS.sendRequest(ro)
The log suggests the switch worked:
20:30:39.657 INFO Proxy Info: ProxyInformation { proxyOption=MANUAL_CONFIG, proxyServerType=HTTP, username=, password=, proxyServerAddress=xxx, proxyServerPort=yyy, executionList=“*.subdomain.domain.com”, isApplyToDesiredCapabilities=true }
20:30:39.683 INFO Proxy Info FOR THIS REQUEST: ProxyInformation { proxyOption=NO_PROXY, proxyServerType=null, username=null, password=, proxyServerAddress=null, proxyServerPort=0, executionList=“null”, isApplyToDesiredCapabilities=false }
… but the HAR showed that the request went through the proxy (and failed). In other words, the proxy info which I had setup was just ignored.
Thanks in advance for any help.
Regards,
– Michel