6

I'm getting the below error when I'm trying to run a test case in RobotFramework. I installed Selenium2Library but it looks like RF can't find it. Everything works fine with SeleniumLibrary.

Selenium2Library is installed in C:\Python27\lib\site-packages. I uninstalled and installed it a few times to make sure the installation is correct. There were no errors during the installations.

Any ideas where to look for the problem?

Here is the error:

c:\testing>pybot testone.txt [ ERROR ] Error in file 'c:\testing\testone.txt' in table 'Settings': Importing test library 'Selenium2Library' failed: ImportError: No module named selenium Traceback (most recent call last): File "C:\Python27\lib\site-packages\Selenium2Library\__init__.py", line 2, in <module> from keywords import * File "C:\Python27\lib\site-packages\Selenium2Library\keywords\__init__.py", line 3, in <module> from _browsermanagement import _BrowserManagementKeywords File "C:\Python27\lib\site-packages\Selenium2Library\keywords\_browsermanagement.py", line 4, in <module> from selenium import webdriver PYTHONPATH: C:\Python27\lib\site-packages\robot\libraries C:\Python27\lib\site-packages C:\Windows\system32\python27.zip C:\Python27\DLLs C:\Python27\lib C:\Python27\lib\plat-win C:\Python27\lib\lib-tk C:\Python27 C:\Python27\lib\site-packages\wx-2.8-msw-unicode 
1
  • The above fix only works if you have an internet connection, otherwise you will have to install manually. Commented Jul 12, 2018 at 8:21

2 Answers 2

17

Resolved the problem by removing Selenium2Library folder and reinstalling it with pip command (which installs all necessary packages).

pip install robotframework-selenium2library 
Sign up to request clarification or add additional context in comments.

Comments

0

I also had a similar problem. I'm running both Python 3.7 and 3.8 because RIDE does not work with 3.8.

I had installed robot framework for Python 3.8 before, and after that I installed everything on 3.7. The problem was fixed when I uninstalled robot framework (and every package related to it) from 3.8 and installed every package on Python 3.7 only.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.