Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:22:20+00:00 2026-06-01T08:22:20+00:00

I need to test a JS geolocation functionality with Selenium and I am using

  • 0

I need to test a JS geolocation functionality with Selenium and I am using chromedriver to run the test on the latest Chrome.

The problem is now that Chrome prompts me to enable Geolocation during the test and that I don’t know how to click that little bar on runtime, so I am desperately looking for a way to start the chromedriver and chrome with some option or trigger to enable this by default. All I could find here was however how I can disable geolocation altogether.

How can I solve this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:22:21+00:00Added an answer on June 1, 2026 at 8:22 am

    In the known issues section of the chromedriver wiki they said that you Cannot specify a custom profile

    This is why it seems to me that @Sotomajor answer about using profile with Chrome as you would do with firefox will not work.

    In one of my integration tests I faced the same issue. But because I was not bothering about the real geolocation values, all I had to do is to mock window.navigator.gelocation

    In you java test code put this workaround to avoid Chrome geoloc permission info bar.

    chromeDriver.executeScript("window.navigator.geolocation.getCurrentPosition = function(success) {
      var position = {
        "coords": {
          "latitude": "555",
          "longitude": "999"
        }
      };
      success(position);
    }");
    

    latitude (555) and longitude (999) values here are just test value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to test an application that processes SIP requests. For now, I want
I need to test web API functions in REST format. Currently using Selenium RC
I need to test a function that needs to query a page on an
I need to test a url that it does not end with .asp So
I need to test a web form that takes a file upload. The filesize
I need to test for general URLs using any protocol (http, https, shttp, ftp,
I need to test some ASP.NET code that handles timeout exceptions from a call
Using the HTML5 Geolocation API I've ended up with some variables in Javascript that
I need to test my web application using the Apache web server. I need
I need to test that a DateTime is at the beginning of a some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.