1
votes

I've been working on automation and robot framework for a couple of months now and have been able to find most of the answers that I need by searching on the internet. But currently I'm stuck with how to modify windows registry during running test cases.

When I searched online, I found this python package - WinRegistry 0.8.3 for modifying the registry. https://pypi.python.org/pypi/winregistry/0.8.3

Python was able to download and install this package when I ran "pip install winregistry".

I added "Library winregistry" to my script's settings and I am able to navigate to the keywords (read value, write value) when I press Ctrl+B on the keyword in my script. But at run-time, robot framework is not able to find the keyword. It errors out saying "No keyword with name 'read value' found."

Do I need to any other step to get this to work ? If anybody knows, please help me out.

Thanks, in advance !

2
I got around this issue by writing a batch file which uses the reg.exe to change the registry setting. But it'll be nice to have keywords available so that I can directly update it from the scripts. Preferably the keywords should be part of the Selenium Library - Dithos

2 Answers

2
votes

winregistry uses winreg which is only available for Python 3. For Python 2.7 it should use _winreg.

I replace all winreg with _winreg in C:\Python27\Lib\site-packages\winregistry\winregistry.py and it works for me.

1
votes

As seen on the PyPI page you linked, you should import the module as winregistry.robot and not just winregistry

*** Settings ***
Library    winregistry.robot

This is likely because this module isn't strictly meant for Robot Framework usage, and the module's author separated the keywords into a subclass of his module.