0

When I open a webpage which is in foreign language using selenium webdriver in chrome, it isn't automatically translated to English. How do I over ride this behavior?

When I manually open the same page it is being translated automatically. Is there some kind of configuration in chrome driver that disables automatic translation? Is there a way to enable the same?

nj-ath
  • 3,028
  • 2
  • 25
  • 41

1 Answers1

2

Did you try loading your Chrome WebDriver using you current user profile ? I think that should do the trick for you.

String userProfile= "C:\\Users\\<your user dir>\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\";
ChromeOptions objOptions = new ChromeOptions();
objOptions.addArguments("user-data-dir=" + userProfile);
objOptions.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(objOptions);
driver.navigate.to("<your url here>");
DRVaya
  • 443
  • 4
  • 13