Reputation: 51
I would like to change browser language. but it is not working. default browser language is displayed..
capabilities: [{
browserName: 'chrome',
chromeOptions: {
args: ['--lang=ja']
}
}],
Upvotes: 5
Views: 3612
Reputation: 4112
If anyone is still interested in making this work, the WebdriverIO implementation would be:
capabilities: [{
browserName: 'chrome',
'goog:chromeOptions': {
args: [ '--your-args-go-here',
'--like-so',
'--and-so-and-so'
// e.g: '--headless', '--disable-gpu', '--start-fullscreen'
],
prefs: {
'intl.accept_languages': 'ru,RU'
}
}
}]
args
array values), click here.prefs
object properties), click here.Note: another useful resource (which is always up to date) for Chromium switches is Peter Beverloo's Chromium CLI Switches portal.
Using the above Chrome config in the wdio.conf.js
& running an Instagram login test will successfully convert the locale of the page to Russian, as seen below:
Upvotes: 5
Reputation: 21
could you try this instead?
options = webdriver.ChromeOptions()
options.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'})
driver = webdriver.Chrome(chrome_options=options)
check on webdriver io how to use add_experimental_option
Upvotes: 1