# Automate tests with Firefox to save approval of using location for WebUI testing

**URL:** <https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [January 17, 2020, 6:40pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782 "2020-01-17T18:40:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgeabler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/tgeabler/32/16104_2.png) [@tgeabler](https://forum.katalon.com/u/tgeabler)\
**Post date:** [January 17, 2020, 6:40pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/1 "2020-01-17T18:40:41Z")

</div>

I am new to automation and trying to do testing with multiple browsers. What I have is working in Chrome, but Firefox has been a bit more of an issue. I am testing logging in a website and going to a page that can use my location information to get weather data. As soon as I log in, I get a Firefox request for permission to get location. I have been trying unsuccessfully to create a separate Firefox profile that I access during testing that will allow location and save it. If I click save during testing and I don’t click to remember on log in, it will ask again when I go to the weather page and click a “Get Current” button for local date and weather data. My first image is the message I get on login

 ![FF location](https://europe1.discourse-cdn.com/katalon/original/2X/1/1796a09f9433e26ed5d148b1c139e2bf4d4b3073.png)

Next image is my profile dictionary in Web UI Desired Capabilities in Project Settings

 ![FF Property Args](https://europe1.discourse-cdn.com/katalon/original/2X/f/fc32deadee08aedba2727ae862e5ac01bda7c44c.png)

Next is the code I am using for login

 ![Log In](https://europe1.discourse-cdn.com/katalon/original/2X/e/e03b1355c009ba3c3bd11b129d62aba53de67304.png)

Finally I have the code I am trying to use to get the created Firefox profile that is copied from previous posts

 ![FF Profile - Copy](https://europe1.discourse-cdn.com/katalon/original/2X/8/8ce8a247f3eee0d5a080ddb50dbc5c98e3ab3e42.png)

Any assistance is greatly appreciated

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [January 22, 2020, 6:16am UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/2 "2020-01-22T06:16:33Z")

</div>

@Russ_Thomas  
@Brandon_Hein  
@anon46315158  
@kazurayam

Any suggestion guys ? I don’t have much experience on this.

---

<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:** [January 22, 2020, 5:21pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/3 "2020-01-22T17:21:56Z")

</div>

One thing to try, that I just recently noticed. The following does not work:

```
WebDriver driver = new FirefoxDriver(...);
DriverFactory.changeWebDriver(driver);
WebUI.openBrowser(...);

```

What this will do is:

1.) `new FirefoxDriver(...)` will open a new browser instance and driver, with your custom capabilities/options.  
2.) `DriverFactory.changeWebDriver(driver)` will correctly give KS a reference to your custom driver.  
3.) `WebUI.openBrowser(...)` \<- this is the problem. This will close your custom browser/driver, and open a new one, without your custom settings.

I’m not exactly sure of your order of operations, but it looks like this may be causing you problems. If instead of calling `WebUI.openBrowser(...)` you call:

`WebUI.navigateToUrl(...)`

… you’ll notice that your custom browser/driver remains active, and KS uses that instead.

---

<div class="post-metadata">

**Author:** ![tgeabler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/tgeabler/32/16104_2.png) [@tgeabler](https://forum.katalon.com/u/tgeabler)\
**Post date:** [March 3, 2020, 8:36pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/4 "2020-03-03T20:36:35Z")

</div>

@Brandon_Hein Thank you for the response. I am coming back to this after being on another project. I went through and do not seem to have openBrowser and do have navigateToUrl, but I still seem to have the location access question every time I run in Firefox. Wasn’t sure if you knew of any other work around to that it save the permission to have access to my location?

---

<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:** [March 3, 2020, 9:56pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/5 "2020-03-03T21:56:01Z")

</div>

The following StackOverflow issue tells that you can create a firefox driver which is “geo.enabled” prerference is set “true”.

> <https://stackoverflow.com/questions/34740547/how-to-enable-geolocation-permissions-for-a-website-in-firefox-profile-using-sel>

---

<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:** [March 3, 2020, 9:59pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/6 "2020-03-03T21:59:01Z")

</div>

@tgeabler

Could you share your Application Under Test’s URL which challenges “Allow Location Access”?

---

<div class="post-metadata">

**Author:** ![tgeabler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/tgeabler/32/16104_2.png) [@tgeabler](https://forum.katalon.com/u/tgeabler)\
**Post date:** [March 4, 2020, 12:56pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/7 "2020-03-04T12:56:29Z")

</div>

@kazurayam I am actually working on it in our Dev environment behind our company firewall so you will not be able to access it. Is there a way to set profile preferences with Katalon rather than creating a firefox driver?

---

<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:** [March 4, 2020, 1:11pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/8 "2020-03-04T13:11:48Z")

</div>

> **[Desired Capabilities](https://docs.katalon.com/katalon-studio/docs/introduction-to-desired-capabilities.html)**
>
> Desired Capabilities are key/value pairs that tell the browser properties such as browser name, browser version, and the path of the browser driver in the system to determine the browsers'...

---

<div class="post-metadata">

**Author:** ![tgeabler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/tgeabler/32/16104_2.png) [@tgeabler](https://forum.katalon.com/u/tgeabler)\
**Post date:** [March 4, 2020, 3:19pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/9 "2020-03-04T15:19:43Z")

</div>

@kazurayam Would the method presented in this thread work for what I am trying to do? [How to set Firefox -profile in Katalon Studio 6.2.1](http://forum.katalon.com/t/how-to-set-firefox-profile-in-katalon-studio-6-2-1/35351)

---

<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:** [March 4, 2020, 10:11pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/10 "2020-03-04T22:11:46Z")

</div>

> [@tgeabler](#):
>
> Would the method presented in this thread work for what I am trying to do?

I don’t know.

Browsers (FF, Chrome, …) have so many preferences/properties/desired capabilities to solve so many customisation requirements that there is no comprehensive resource that tells you for-what and how. All we can do is to make Google-searchs a lot for know-how fragments, and try them yourself against your Application Under Test. That is the reason why I asked you if your AUT is accessible for me. Unfortunately your AUT is not public. Ok, then. Please help yourself.

---

<div class="post-metadata">

**Author:** ![tgeabler](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/tgeabler/32/16104_2.png) [@tgeabler](https://forum.katalon.com/u/tgeabler)\
**Post date:** [March 5, 2020, 1:44pm UTC](https://forum.katalon.com/t/automate-tests-with-firefox-to-save-approval-of-using-location-for-webui-testing/38782/11 "2020-03-05T13:44:43Z")

</div>

@kazurayam Thank you for all your assistance and patience with me as I am new to all this automation work and working with software in general. Even if I provided my URL it wouldn’t work outside of my company. I will keep working on this on my end and reach out if I have any more issues or reach a solution. Thank you again.
