How do I enable geolocation support in chromedriver?

前端 未结 7 597
日久生厌
日久生厌 2020-11-30 08:08

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

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 08:27

    As for your initial question:

    You should start Firefox manually once - and select the profile you use for Selenium.

    Type about:permissions in the address line; find the name of your host - and select share location : "allow".

    That's all. Now your Selenium test cases will not see that dreaded browser dialog which is not in the DOM.

提交回复
热议问题