I have just added this bit of code to the Project Settings, Desired Capabilities, WebUI, Chrome
Name: args
Type: List
Value: ["--lang=en-GB"]
I expected this code to make English UK the default language of chrome each time a driver starts up but still chrome is still default loading in american English.
What other change can i do to ensure the chrome window opens with the UK English language?
Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.
In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!
Another approach is to set the language preference directly in the Chrome options. You can do this by adding custom code to your test case or a custom keyword. Here’s how you can do it:
import org.openqa.selenium.chrome.ChromeOptions
import com.kms.katalon.core.webui.driver.DriverFactory
ChromeOptions options = new ChromeOptions()
options.addArguments("--lang=en-GB")
options.addArguments("--accept-lang=en-GB")
DriverFactory.changeWebDriverWithoutResettingSession(options)
// Now use WebUI.openBrowser('') to open the browser with these options
WebUI.openBrowser('')
You can add this code at the beginning of your test case or create a custom keyword with this code and call it before opening the browser.
If you’re still having issues, you might need to set the language at the system level. In Katalon Studio, you can do this by setting an environment variable:
import org.openqa.selenium.chrome.ChromeOptions
import com.kms.katalon.core.webui.driver.DriverFactory
System.setProperty("webdriver.chrome.driver", DriverFactory.getChromeDriverPath())
System.setProperty("LANGUAGE", "en_GB")
ChromeOptions options = new ChromeOptions()
options.addArguments("--lang=en-GB")
DriverFactory.changeWebDriverWithoutResettingSession(options)
// Now use WebUI.openBrowser('') to open the browser with these options
WebUI.openBrowser('')
Lastly, ensure that you don’t have any conflicting language settings in your Katalon Studio project or system environment variables that might be overriding your Chrome language settings.
and check your chrome language settings