I want to change the browser UI language using Selenium 4 and LambdaTest.
Hello Dipen,
You can change the browser UI language using Selenium 4 and LambdaTest using the following code:
> List<string> args = new List<string>();
> args.Add(“--lang=ar”);
> Dictionary<string, object> optionsg = new Dictionary<string, object>();
> optionsg.Add(“args”, args);
> Dictionary<string, object> ltOptions = new Dictionary<string, object>();
> ltOptions.Add(“build”, “your build name”);
> ltOptions.Add(“name”, “your test name”);
> ltOptions.Add(“platformName”, os);
> ltOptions.Add(“browserName”, browser);
> ltOptions.Add(“browserVersion”, version);
> ltOptions.Add(“user”, “LT_USERNAME”);
> ltOptions.Add(“accessKey”, LT_ACCESS_KEY);
> ltOptions.Add(“goog:chromeOptions”, optionsg);
> EdgeOptions desiredCapabilities = new EdgeOptions();
> desiredCapabilities.AddAdditionalOption(“LT:Options”, ltOptions);
> driver.Value = new RemoteWebDriver(new Uri(seleniumUri), desiredCapabilities);