TestProject Forum

"Allow site to access your location" on Safari and Firefox [SOLVED]

When creating a test, at some point my test will have to navigate to a site that requests my location. On Chrome and Edge this does not appear to be a problem and I am able to bypass this step. However, on Safari and Firefox it appears that I must allow the site to access my location every test.

My first thought was to run the recorder on Safari and Firefox, creating a test that would allow for location. Unfortunately, I believe the Recorder can only open on Chrome so I do not believe I can make a test for either problem browser.

Is there a possible way to work around this issue so that my tests can continue on Firefox and Safari similarly to how they work on Edge and Chrome.

Thanks in advance.

1 Like

I want to know this too, I think there must be a way to set driver capabilities but I haven’t worked it out.

Use Jobs and set custom browser capabilities in there. The only way to do it.
See here: /documentation/webdriver/capabilities/shared_capabilities/

A sample, for chrome, which i use:

{
  "browserName": "chrome",
  "version": 91,
  "goog:chromeOptions": {
    "args": [
      "--ignore-certificate-errors"
    ],
"prefs": {
     "profile.managed_default_content_settings.geolocation" : 1
    }
  }
}