Software Quality Assurance & Testing Asked by thestiggg on December 28, 2020
How can I enable variations in Chrome from chromedriver options?
Hello, I’m facing a problem with Chrome where when I run an automated UI test with chromedriver, there’s issues showing up (such as header is too high which covers other elements) but if I manually open up Chrome and perform the UI tests manually, the issues aren’t there (the header looks correct).
I opened up chrome://version
for both browsers and saw that the instance from automation does not have Variations listed, while the manual run had Variations listed.
I tried adding options.addArgument("--reset-variation-state)
in hopes that it would enable it but it did not do anything.
So, this kinda worked for me. Currently researching better options.
If you go into C:users[username]AppDatalocalGoogleChromeUser Data and find your "Local State" file, there are two entries in there you should see values for -- "variations_compressed_seed" and "variations_seed_signature"
If you copy those values, and add them in your Chrome options before you start ChromeDriver, then variations should be enabled:
chromeOptions.AddLocalStatePreference("variations_compressed_seed", "[your compressed seed]");
chromeOptions.AddLocalStatePreference("variations_seed_signature", "[your seed signature]");
If you don't have those values in your Local State file, you can start Chrome with some dummy data directory, e.g. start > run > chrome.exe --user-data-dir C:/Chrome, then shut down chrome, go to C:Chrome and find the seed and signature in the "Local State" file that gets created in there.
Answered by Marc Plowey on December 28, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP