Selenium C# Chrome Right Click Select Translate to English option

529 views
Skip to first unread message

Radrag Chase

unread,
Sep 23, 2020, 5:03:20 PM9/23/20
to Selenium Users
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.

                

    ddlionx

    unread,
    Sep 24, 2020, 3:38:50 AM9/24/20
    to seleniu...@googlegroups.com
    I think Google has pretty extensively tested Chrome's translation function already. Why exactly are you looking to duplicate this?

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c22f82f4-b4b1-432f-b36b-084c568f1800n%40googlegroups.com.

    Radrag Chase

    unread,
    Sep 30, 2020, 10:16:49 PM9/30/20
    to Selenium Users
    My need is to translate the non-English web application to English. Manually I right click on the page and select translate to English.
    But i need to automate it in C# Selenum, I see python and Java have the chrome options as experimental_options method, but in C# i did not find any such method. Whether it is right click or other means, if my requirement has a solution, i will be grateful for the guidance. Appreciate the help. 

    Reply all
    Reply to author
    Forward
    0 new messages