Original code from Stefan Zimmermann (userzimmermann) at https://bitbucket.org/userzimmermann/robotframework-python3