I need to allow the geo location during my karate web automation test. I was going through this documentation https://github.com/intuit/karate/tree/master/karate-core It has information on handling dialog boxes and popup but they don't seem to be working for the geo location pop up
Asked
Active
Viewed 616 times
1
-
https://stackoverflow.com/questions/38767551/how-can-i-handle-geo-location-popup-in-browser-using-selenium-webdriver – salilgupta12 May 20 '20 at 07:17
1 Answers
0
Thanks to the comment above, looks like for Chrome you can use the addOptions
to pass disable-geolocation
:
* configure driver = { type: 'chrome', addOptions: [`disable-geolocation`] }
I guess it would be similar for other browsers. If needed please consider submitting a PR to the project.
Also note that we are working on Karate Robot that may be able to solve this in the future.

Peter Thomas
- 54,465
- 21
- 84
- 248
-
1Thanks Peter. I used that with below config and it works fine. `* configure driverTarget = { docker: 'ptrthomas/karate-chrome', showDriverLog: true , addOptions: [ 'disable-geolocation' ]}` – salilgupta12 May 20 '20 at 11:38
-
I tried but it shows me this message. ' Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score. ' – salilgupta12 May 20 '20 at 12:55
-
-
Can something like this be used to escape the geo location pop up, ` * input('body', Key.ESCAPE)` , I was going through these articles 1. https://stackoverflow.com/questions/60951153/karate-ui-automation-how-to-press-key-without-necessity-to-be-in-input-field 2. https://stackoverflow.com/questions/60948829/karate-ui-automation-how-to-close-location-allowance-window-chrome and seems like both the problems can be solved in case KEY.ESCAPE work in karate script on full body ? – salilgupta12 Jul 22 '20 at 13:50
-
@salilgupta12 try it and see, and update so we can all learn from you – Peter Thomas Jul 22 '20 at 14:12
-
Thanks for your prompt response. Actually I had tried and as it did not work, hence I thought I will cross check with you in case I am missing something here. I have tried manually, pressing escape makes the geo location pop up go away but in script using ` * input('body', Key.ESCAPE)` does not seem working, so any suggestions on this? – salilgupta12 Jul 22 '20 at 14:35
-
try this: https://stackoverflow.com/a/60800181/143475 - but do try and submit an example for us to analyze and make any fixes to the core framework if needed: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue – Peter Thomas Jul 22 '20 at 15:33