# Disable browser location on Execution

**URL:** <https://forum.katalon.com/t/disable-browser-location-on-execution/58926>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [October 6, 2021, 2:45am UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926 "2021-10-06T02:45:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandro.biancucci](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alejandro.biancucci/32/18162_2.png) [@alejandro.biancucci](https://forum.katalon.com/u/alejandro.biancucci)\
**Post date:** [October 6, 2021, 2:45am UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/1 "2021-10-06T02:45:09Z")

</div>

I’d like to lunch the browser both local and remote execution without using the browser locations feature. How can I achieve that?

Thanks.

---

<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:** [October 6, 2021, 12:55pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/2 "2021-10-06T12:55:08Z")

</div>

Can you explain a bit more?

---

<div class="post-metadata">

**Author:** ![alejandro.biancucci](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alejandro.biancucci/32/18162_2.png) [@alejandro.biancucci](https://forum.katalon.com/u/alejandro.biancucci)\
**Post date:** [October 6, 2021, 4:29pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/3 "2021-10-06T16:29:54Z")

</div>

Sure, when I execute a particular script that involves geolocation it uses the browser’s location feature from Chrome. This means that I get different results when I am at the office or home.

I am just wondering if there is a flag or something that I can set so that when the browser is launched, the locations feature is blocked so that I can get consistent results based on user input.

Hope that explains it. Thanks!

---

<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:** [October 6, 2021, 9:10pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/4 "2021-10-06T21:10:54Z")

</div>

Sit tight.

@Brandon_Hein?

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [October 7, 2021, 3:25pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/5 "2021-10-07T15:25:30Z")

</div>

You’ll definitely need to set a Desired Capability for this. The trick is figuring out which one. Luckily I have a guide for it:

> [@Desired Capabilities - The Missing Manual](http://forum.katalon.com/t/desired-capabilities-the-missing-manual/20748):
>
> One of the biggest hurdles with using Katalon/Webdriver is setting the appropriate Desired Capabilities that configure various browser settings programmatically. There are a couple of reasons for this: 1.) Browsers do not expose these back-end properties in the settings menu. Instead, they offer a user-friendly GUI for configuring settings that are based on these properties. This of course makes sense for 99.9999% of browser users, but isn’t helpful for us. 2.) The appropriate Desired Capabili…

---

<div class="post-metadata">

**Author:** ![alejandro.biancucci](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alejandro.biancucci/32/18162_2.png) [@alejandro.biancucci](https://forum.katalon.com/u/alejandro.biancucci)\
**Post date:** [October 7, 2021, 7:25pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/6 "2021-10-07T19:25:09Z")

</div>

Thank you for the reply, however, I am still facing the issue after trying the suggested solution.

2021-10-07 14:10:57.983 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Chrome’ driver  
Oct 07, 2021 2:10:57 PM org.openqa.selenium.remote.DesiredCapabilities chrome  
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`  
2021-10-07 14:10:57.998 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘acceptInsecureCerts’, ‘true’]  
2021-10-07 14:10:57.999 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘args’, ‘[disable-infobars]’]  
2021-10-07 14:10:57.999 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘pref’, ‘{dir=C:\Users\USERFOLDER\AppData\Local\Temp\scoped\_dir36424\_1848640927\Default\Preferences.txt, default\_content\_setting\_values.geolocation=false, default\_content\_settings.geolocation=false}’]  
2021-10-07 14:10:58.018 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 milliseconds

The browser still opens with the geolocation turned on.

 ![desired-capabilites](https://europe1.discourse-cdn.com/katalon/original/3X/7/6/76f4306364ae618b9a1206e4636ce1f2a1a4e375.png) ![browserLocationON](https://europe1.discourse-cdn.com/katalon/optimized/3X/0/6/06557bfee5fec70ce59d19ee36e8a3665119eb3b_2_690x48.png)

What am I missing? Is it possible to launch the browser with the geolocation turned off?

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [October 11, 2021, 5:18pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/7 "2021-10-11T17:18:51Z")

</div>

Try the args provided in this post:

> <https://stackoverflow.com/questions/65527182/selenium-chromedriver-turn-off-location-for-a-single-site/65527211#65527211>

both in the question as well as the accepted answer. Also, it looks like they are passing this as **args** , not prefs.

---

<div class="post-metadata">

**Author:** ![alejandro.biancucci](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alejandro.biancucci/32/18162_2.png) [@alejandro.biancucci](https://forum.katalon.com/u/alejandro.biancucci)\
**Post date:** [October 12, 2021, 10:24pm UTC](https://forum.katalon.com/t/disable-browser-location-on-execution/58926/9 "2021-10-12T22:24:40Z")

</div>

The following settings worked for me. Workaround was to launch incognito and disable permissions prompt.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/0/5/0579e1230e13a80edc3106b414bd4c6d3988f4fb.png)
