Hi All,
I am trying to automate my test to translate web page from Spanish to English.
Below is what i tried: None of these worked for me. Suggest how to translate Web Page to English. Appreciate the help
(1) ChromeOptions options = new ChromeOptions(); Dictionary<String, Object> prefs = new Dictionary<string, object>(); prefs.Add("translate", "{\"enabled\":\"true\"}"); prefs.Add("translate_whitelists", "{\"br\":\"en\"}"); options.AddUserProfilePreference("prefs", prefs);
IWebDriver driver = new ChromeDriver(DriverPath, options);
(2) Right Click on browser:
Actions action = new Actions(driver); action.ContextClick(productLink).SendKeys(Keys.ArrowDown).SendKeys(Keys.ArrowDown).SendKeys(Keys.Return).Build().Perform();
This right clicks on browser opens options, but i could not select the 'Translate To English' option in that menu.