SeleniumLibrary
SeleniumLibrary copied to clipboard
support robot 5.0
import SeleniumLibrary
(.venv) C:\Users\user\project>c:/Users/user/project/.venv/Scripts/python.exe c:/Users/user/project/Sandpit/test.py
Traceback (most recent call last):
File "c:\Users\user\project\Sandpit\test.py", line 52, in <module>
import SeleniumLibrary
File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\__init__.py", line 33, in <module>
from SeleniumLibrary.keywords import (
File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\__init__.py", line 18, in <module>
from .browsermanagement import BrowserManagementKeywords # noqa
File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\browsermanagement.py", line 30, in <module>
from .webdrivertools import WebDriverCreator
File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\webdrivertools\__init__.py", line 17, in <module>
from .webdrivertools import WebDriverCreator # noqa
File "c:\Users\user\project\.venv\lib\site-packages\SeleniumLibrary\keywords\webdrivertools\webdrivertools.py", line 25, in <module>
from robot.utils import ConnectionCache, StringIO
ImportError: cannot import name 'StringIO' from 'robot.utils' (c:\Users\user\project\.venv\lib\site-packages\robot\utils\__init__.py)
my understanding is that StringIO
has been removed in 5.0 https://github.com/robotframework/robotframework/issues/4150
Good catch! I now added robot.utils.StringIO
back to avoid breaking old SL versions, but that usage should definitely be removed.
Ping @emanlove! SL should stop using robot.utils.StringIO
and use io.StrinIO
instead. The former is effectively deprecated and will be removed in the future.