O'Reilly logo

Selenium Testing Tools Cookbook by Unmesh Gundecha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying a Windows registry value from Selenium WebDriver

The WindowsUtils class also provides methods to update existing Windows registry values or create new registry keys and values. Similar to reading registry values, WindowsUtils class provides multiple methods to modify keys and values.

In this recipe, we will use the WindowsUtils class to create a new registry key with a string value.

How to do it...

Use the writeStringRegistryValue() method for modifying existing Windows registry value or creating a new key and value represented as a string.

WindowsUtils.writeStringRegistryValue("HKEY_CURRENT_USER\\SOFTWARE\\Selenium\\SeleniumVersion", "2.24"); assertEquals("2.24",WindowsUtils.readStringRegistryValue("HKEY_CURRENT_USER\\SOFTWARE\\Selenium\\SeleniumVersion")); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required