How to change Chrome Browser language to English?

1,740 views
Skip to first unread message

adato...@gmail.com

unread,
May 23, 2018, 10:43:25 AM5/23/18
to robotframework-users
My chrome opened by robot framework test case is in Chinese, I have below key word to change it to English. While browser also displays Chinese.


Open Login Page In Chrome
  [Arguments]   ${URL}
  [Documentation]  Open the login page in Chrome browser.

  ${options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
  Call Method    ${options}    add_argument    --lang\=en-us
  Create WebDriver    Chrome    chrome_options=${options}
  Go To    ${URL}

I also tried below in python interactive shell, also open Chrome in Chinese. Does anyone know how to fix it?

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--lang=de")
chrome=webdriver.Chrome(chrome_options=options)

Tatu Aalto

unread,
May 28, 2018, 2:30:14 AM5/28/18
to adato...@gmail.com, robotframework-users
Ugh

I think the most easiest solution to your problem, is to create a library keyword, which opens the browser as you want in the Python side. Then you can use the SeleniumLibrary public API [1], to register the the WebDriver back to the SeleniumLibrary.

-Tatu
Send from my mobile

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Anne kootstra

unread,
Jun 4, 2018, 4:40:37 AM6/4/18
to robotframework-users
Have you tried using: 

Call Method    ${options}    add_argument    lang\=en-us

or

options.add_argument("lang=de")


Kind regards,

-Anne

Op woensdag 23 mei 2018 16:43:25 UTC+2 schreef adato...@gmail.com:
Reply all
Reply to author
Forward
0 new messages