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

  1. "webdriver.firefox.profile" : "webdriver"

  2. 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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -