Enable Opera Turbo in Selenium Opera Webdriver

I need to enable Turbo Opera mode (34.0.2036.25) in an instance of Opera Webdriver.

I found the settings file with JSON inside: C:\Users\username\AppData\Roaming\Opera Software\Opera Stable\preferences

 "turbo": { "client_id": "86161eba4fe344be368c664164a0692d9d7d6d367e2e712e49321dee0ea4351e", "enabled": true, "show_learn_more": false } 

When I change enable: from false to true and start Opera manually, it starts in Turbo mode.

Selenium webdriver opens Opera with some virtual profile by default, and obviously Turbo mode is disabled.

I tried this code:

 OperaOptions options = new OperaOptions(); options.AddUserProfilePreference("turbo.enabled", true); OperaDriver driver = new OperaDriver(options); driver.Navigate().GoToUrl("http://www.google.com"); 

Besides turbo.enabled, true , I tried to use hundreds of different ways to feed this parameter to the AddUserProfilePreference method, but Opera never started in Turbo mode.

I found a temporary profile and preference file located at: C: \ Users \ username \ AppData \ Local \ Temp \ scoped_dir8248_11147

no "enabled": true, obviously. So the question is how to get Opera to add this parameter to the temp profile

 "turbo": { "client_id": "34e3abeca0944cd655ee41e9aa1a87d58bc5605e319f56b6c6de983f7fcf668e" } 
+5
source share

Source: https://habr.com/ru/post/1238029/


All Articles