问题
While executing selenium tests on firefox using nightwatch.js, the test where our application selects geolocation keeps failing because of a pop-up in firefox asking to allow access keeps blocking the test It works fine on chrome when the configuration is set to
"chromeOptions": {"args": ["--no-sandbox","--disable-infobars"]}
However, the below options for firefox does not seem to work
"firefox": {
"selenium_port": 1234,
"desiredCapabilities": {
"browserName": "firefox",
"browserVersion": "74.0",
"javascriptEnabled": true,
"acceptSslCerts": true,
"acceptInsecureCerts": true,
"typeerrorEnabled": true,
"marionette": true
},
"firefoxOptions": {
"args": [
"--headless",
"--no-sandbox",
"disable-infobars",
"disable-notifications",
"use-fake-device-for-media-stream",
"use-fake-ui-for-media-stream",
"disable-web-security",
"--log",
"debug"
],
"binary" : ".bin/geckodriver"
}
}
I would like to know if I am missing anything here, or if you could point me in the correct direction. (Adding an image for more visibility and clarification)
来源:https://stackoverflow.com/questions/62204758/unable-to-handle-location-access-pop-up-on-firefox-using-nightwatch-js