Jenkins - AttributeError: 'NoneType' object has no attribute 'write' after upgrading Selenium2Library

Hello,
I have a project in Jenkins where test scenarios are run with a Windows batch command: robot [arguments]
The project worked fine until I upgraded Selenium2Library with
pip install --upgrade robotframework-selenium2library
The scenarios run fine in a windows command prompt. When running it on Jenkins, I get the error AttributeError: 'NoneType' object has no attribute 'write'
No output.xml file is generate from the runs in Jenkins.
I have python 3.9.7 installed
I am kind lost here and don’t even know what other information I should provide.
Thank you for any insight!

Hi Pedro,

From the SeleniumLibrary introduction:

SeleniumLibrary is based on the old SeleniumLibrary that was forked to Selenium2Library and then later renamed back to SeleniumLibrary. See the Versions and History sections below for more information about different versions and the overall project history.

Selenium2Library is the old library so not an upgrade but a downgrade, I suggest you go back to SeleniumLibrary (the current version) and see if you still have an issue?

Dave.

Hi,

I’m also facing the same issue “AttributeError: ‘NoneType’ object has no attribute ‘write’” with Log keyword. I’m trying to log a message with “level=WARN” with “html=True” which will give background colour to the warning message. While running the test case from windows command prompt I’m not seeing the failure in the Log keyword(working as expected). But while executing the test cases from Jenkins Im seeing a failure in BuiltIn Log keyword. Please help me to understand the root cause