# How to set proxy programatically

**URL:** <https://forum.katalon.com/t/how-to-set-proxy-programatically/14350>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [November 20, 2018, 10:22am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350 "2018-11-20T10:22:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepteja\_mummmoji](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sandeepteja\_mummmoji](https://forum.katalon.com/u/sandeepteja_mummmoji)\
**Post date:** [November 20, 2018, 10:22am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/1 "2018-11-20T10:22:00Z")

</div>

Is there any way to set proxy programatically?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [November 20, 2018, 3:09pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/2 "2018-11-20T15:09:01Z")

</div>

I know how to but before telling it, let me ask you. Why do you want to do that?

---

<div class="post-metadata">

**Author:** ![thuanqtran](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@thuanqtran](https://forum.katalon.com/u/thuanqtran)\
**Post date:** [September 18, 2019, 5:19pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/3 "2019-09-18T17:19:44Z")

</div>

I’m new to Katalon, and we have 6.3.3.

It was mentioned that Katalon does not have an exception list in its proxy setting.  
This causes internal address to be forwarded to the proxy.

Until there is an exception list, I’m thinking of setting the proxy when Katalon starts in order to load the plugins, and then programmatically turn off the proxy when the testing starts.

Is there a way to set the proxy settings to “No proxy”?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 18, 2019, 9:43pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/4 "2019-09-18T21:43:11Z")

</div>

> [@kazurayam](#):
>
> I know how to but before telling it,

I wrote this 10 months ago. But now I am against what I said.

I do not think there is a way to change the proxy settings of Katalon Studio programmatically (by test case script, test listener script) once Katalon Studio started.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 19, 2019, 7:46am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/5 "2019-09-19T07:46:51Z")

</div>

I have found a work around.

You will set “Manual Proxy Configuration” to Katalon Studio. This will let “Reload plugins” operation to success. But your test case scripts will be unable to reach to the hosts on your intranet.

Now you can use Desired Capability to tell Chrome browser of proxy configuration. Chrome browser accepts `--proxy-bypass-list` option. You can specify the host name (ip address) of your target host on your intranet.

 ![--proxy-bypass-list](https://europe1.discourse-cdn.com/katalon/original/2X/7/7224b52d512a047e3443a7b207467a4ece3d064b.png)

This worked for me.

Also it is possible to set the Desired Capabilities for browsers programatically.

---

<div class="post-metadata">

**Author:** ![thuanqtran](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@thuanqtran](https://forum.katalon.com/u/thuanqtran)\
**Post date:** [September 19, 2019, 12:27pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/6 "2019-09-19T12:27:15Z")

</div>

We are testing Web services (GET http://…) directly without going through the browser, so I believe in this scenario, it’s Katalon that resolves the URL, at least at the Object repo level.

An exception list, i.e. proxy bypass per Eclipse’s parlance, would definitely fix the issue. Is there a reason why the proxy setting screen does not have a proxy bypass?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 19, 2019, 1:12pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/7 "2019-09-19T13:12:24Z")

</div>

In my opinion, using command-line switches for browsers or the Desired Capability to configure browsers proxy setup for WebUI testing is fine as long as these options work.

I think that **Katalon Studio’s current [Proxy Preference](https://docs.katalon.com/katalon-studio/docs/proxy-preferences.html) design is ambiguous**. The current design does not make it clear who consumes the proxy information?

1. Katalon Studio for reloading plugins, communicating with Katalon Analytics,
2. Browsers (for reaching to the Applicaton Under Test)?
3. Katalon Studio for WebService/API testing without browsers

As for the case1, Proxy config for Katalon Studio to communicate with Plugin Store and Katalon Analysis — this would NEVER require --proxy-bypass-list

As for the case2, Proxy config as Desired Capabilities for Browsers to let it communicate with hosts both on the internet and the intranet — this would require --proxy-bypass-list and Proxy Auto Configuration support

As for the case3, Proxy config for WebService/API test, this would require --proxy-bypass-list and PAC.

well, Proxy config with moving targets tends to make confusion.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [September 19, 2019, 2:17pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/8 "2019-09-19T14:17:29Z")

</div>

@ThanhTo @devalex88 @duyluong

Guys, can we get some clarity on this? (See above).

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 18, 2019, 5:15am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/9 "2019-10-18T05:15:40Z")

</div>

I have made a new post:

> [@Launching browsers with Proxy Auto-config for Katalon Test cases](http://forum.katalon.com/t/launching-browsers-with-proxy-auto-config-for-katalon-test-cases/34888):
>
> I made a demo project on GitHub: Background Quite a few Katalon Studio users work behind the corporates Proxy server. Me too. You can setup a Proxy for Katalon Studio. See [“Proxy Preference”](https://docs.katalon.com/katalon-studio/docs/proxy-preferences.html) page. Katalon Studio referes to this proxy config in several ways. The browser opend by WebUI.openBrowser() on your PC (which is behind the corporate’s Proxy) will have the same proxy as configured for Katalon Studio. The Katalon test scripts will have access to the URLs on the Internet through tha…

Here I used PAC (Proxy Auto-config).

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [October 23, 2019, 3:07am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/10 "2019-10-23T03:07:50Z")

</div>

Hi guys!

Katalon Studio 7.0.0 supports passing proxy details through the script. You can see more details [here](https://docs.katalon.com/katalon-studio/docs/proxy-preferences.html#pass-proxy-details-through-the-script).

I’m glad to let you know we have just released the official version of Katalon Studio 7.0.0. Please first check out the [release note](https://docs.katalon.com/katalon-studio/new/version-70.html) and click [here](https://www.katalon.com/download/) to download.

Cheers

Jass

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 23, 2019, 3:55am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/11 "2019-10-23T03:55:24Z")

</div>

> [@Jass](#):
>
> Katalon Studio 7.0.0 supports passing proxy details through the script.

Does it support PAC?

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [October 23, 2019, 7:24am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/12 "2019-10-23T07:24:50Z")

</div>

Hi @kazurayam

Unfortunately, PAC file is not supported in Katalon Studio 7.0.0.

Jass

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 23, 2019, 10:25am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/13 "2019-10-23T10:25:05Z")

</div>

PAC is important for me.

PAC is the only method for me to solve Proxy problems completely in the corporate’s network where I am working.

I would request PAC file support in Katalon Studio.

---

<div class="post-metadata">

**Author:** ![Michiel\_van\_Erp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/michiel_van_erp/32/428_2.png) [@Michiel\_van\_Erp](https://forum.katalon.com/u/Michiel_van_Erp)\
**Post date:** [November 14, 2019, 4:22pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/14 "2019-11-14T16:22:06Z")

</div>

What about the --no-proxy-server Web UI possibility, in the Project settings?

Right now I need to configure a proxy in Kalaton to be able to activate the product.  
But I need it disabled when recording/playing back tests on our local (intranet) machine, because I can’t access that machine with an enabled proxy.

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [November 15, 2019, 2:45am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/15 "2019-11-15T02:45:17Z")

</div>

@Michiel_van_Erp

I wonder if the proxy exception list can help you in that case. If yes, the good news is we will release it soon in the upcoming versions.

Jass

---

<div class="post-metadata">

**Author:** ![Michiel\_van\_Erp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/michiel_van_erp/32/428_2.png) [@Michiel\_van\_Erp](https://forum.katalon.com/u/Michiel_van_Erp)\
**Post date:** [November 15, 2019, 8:58am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/17 "2019-11-15T08:58:45Z")

</div>

Great news, thanks!

---

<div class="post-metadata">

**Author:** ![huynguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/huynguyen/32/552_2.png) [@huynguyen](https://forum.katalon.com/u/huynguyen)\
**Post date:** [November 24, 2019, 4:22pm UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/18 "2019-11-24T16:22:02Z")

</div>

Hi @kazurayam,  
Since version 7.1.0, we have improved Katalon’s capability to detect system proxy, including those defined by PAC file. Please configure your system proxy to use PAC file, and configure Katalon to use system proxy.  
Regards.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [November 25, 2019, 1:27am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/19 "2019-11-25T01:27:49Z")

</div>

@huynguyen

I tried v7.1.0 and found that the PAC setup to my Windows OS is respected by Katalon Studio if I choose “Use System Proxy configuration”.

I hope you to rewrite the official documentation [https://docs.katalon.com/katalon-studio/docs/proxy-preferences.html](https://docs.katalon.com/katalon-studio/docs/proxy-preferences.html) to state more clearly that the PAC is supported by KS and how to utilize it.

---

<div class="post-metadata">

**Author:** ![huynguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/huynguyen/32/552_2.png) [@huynguyen](https://forum.katalon.com/u/huynguyen)\
**Post date:** [November 25, 2019, 3:47am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/20 "2019-11-25T03:47:03Z")

</div>

Hi @kazurayam,  
We will update the docs accordingly. Thank you.  
Regards.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [December 12, 2019, 7:19am UTC](https://forum.katalon.com/t/how-to-set-proxy-programatically/14350/21 "2019-12-12T07:19:49Z")

</div>

I re-examined the PAC support. See the following post:

> [@Proxy Auto config (PAC) support by Katalon Studio 7.1.0 is incomplete](http://forum.katalon.com/t/proxy-auto-config-pac-support-by-katalon-studio-7-1-0-is-incomplete/37428):
>
> Once Katalon team mentioned that Katalon Studio 7.1.0 supported Proxy Auto config. Katalon team stated Please configure your system proxy to use PAC file, and configure Katalon to use system proxy. OK, I will examine this change again. Let me report the result. I thought that I should test if “Use system proxy configuration option” option works for the following 5 cases: After clean installation, Katalon Studio asks us to activate it. While Activation processing, Katalon Studio needs co…
