javascript - Set Firefox Preferences in Nightwatch -
how set firefox preferences in nightwatch? equivalent in java nightwatch.
firefoxprofile profile = new firefoxprofile(); profile.setpreference("intl.accept_languages", "de"); webdriver driver = new firefoxdriver(profile);
i have working in chrome, again can't figure out how in firefox.
"desiredcapabilities": { "browsername": "chrome", "javascriptenabled": true, "acceptsslcerts": true, "chromeoptions" :{ "prefs": { "intl.accept_languages":"fr" } } }
thanks
the solution create firefox profile nightwatch test.
1) create new firefox profile:
in terminal, execute command : "firefox -p"
create profil name "webdriver".
2) configure new profile
go config page url : about:config
search name "intl.accept_languages" , update value.
exit firefox now.
3) configure nightwatch use new profile
"webdriver.firefox.profile" : "webdriver"
list item "browsername" : "firefox"
be careful ! not "desiredcapability" parameter.
solution 1: (test config)
{ "yourtest" : { "default" : { ... "webdriver.firefox.profile" : "webdriver", "launch_url": "http://localhost:3000", "desiredcapabilities" : { "browsername" : "firefox", "javascriptenabled" : true, "acceptsslcerts" : true } } } }
solution 2: (global config)
{ ... "selenium" : { "start_process" : false, "server_path" : "", "log_path" : "", "host" : "127.0.0.1", "port" : 4444, "cli_args" : { "webdriver.chrome.driver" : "", "webdriver.ie.driver" : "", "webdriver.firefox.profile" : "webdriver" } }, ... "yourtest": { "default": { "launch_url": "http://localhost:3000", "desiredcapabilities" : { "browsername" : "firefox", "javascriptenabled" : true, "acceptsslcerts" : true } }, ... } ... }
check selenium settings : http://nightwatchjs.org/guide#selenium-settings
Comments
Post a Comment