Enable Opera Turbo in Selenium Opera Webdriver
Asked Answered
M

0

6

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

I found preferences 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 run Opera manually it starts in Turbo mode.

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

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 hundreds of different ways feed this parameter to AddUserProfilePreference method but Opera never started in Turbo mode.

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

there is no "enabled": true there obviously. So the question is how to force Opera to add this option to temp profile

"turbo": {
    "client_id": "34e3abeca0944cd655ee41e9aa1a87d58bc5605e319f56b6c6de983f7fcf668e"
}
Moshemoshell answered 13/12, 2015 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.