I am using webdriverio as automation tool and I want to launch google chrome where geolocation is already allowed so that it would not ask/show the notification box for asking to allow/block the location. This could be a duplicate of below question link but I tried the solution given there and it works fine when I set the geolocation=2 (meaning to block) but its not working when I set geolocation=1 (meaning to allow) as the chrome browser is still asking to allow/block the location, weird that the other option(2-block) worked but (1-allow) did not.
Webdriverio/chimpjs - Launch Google Chrome with Gelocation permitted
so I used the answer from the link into my wdio.conf.js like this:
browserName: 'chrome',
'goog:chromeOptions': {
args: [
'incognito',
'disable-gpu',
'no-sandbox',
'window-size=1920,1080',
'start-maximized',
],
prefs: {
'credentials_enable_service': false,
'profile': {
'password_manager_enabled': false,
'default_content_setting_values': {
'geolocation': 1
}
}
},
w3c: true,
}