# Selenium2library does not load

**URL:** <https://forum.robotframework.org/t/selenium2library-does-not-load/1419>\
**Category:** Development\
**Created:** [3 March 2021 09:43 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419 "2021-03-03T09:43:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelhead](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@pixelhead](https://forum.robotframework.org/u/pixelhead)\
**Post date:** [3 March 2021 09:43 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/1 "2021-03-03T09:43:49Z")

</div>

I tried a first mini test script from a tutorial and the setting of selenium2library does not load (or whatever).

\*\*\* Settings \*\*\*  
Library selenium2library

I am new to this and I checked many questions and websites to this issue but … I simply do not find a solution. What is my error, what is missing?

Thank you very much for helping.

Configuration and versions:

Windows 10  
Python 2.7.14  
PyCharm Community 2017.3  
IntelliBot Version 0.10.143.381  
pip 9.0.1 from c:\python27\lib\site-packages (python 2.7)  
Robot Framework 3.2.2 (Python 2.7.14 on win32)

pip list:  
pip (9.0.1)  
robotframework (3.2.2)  
robotframework-pythonlibcore (2.2.1)  
robotframework-selenium2library (3.0.0)  
robotframework-seleniumlibrary (4.5.0)  
selenium (3.141.0)  
setuptools (28.8.0)  
urllib3 (1.26.3)

Geckodriver for Firefox:  
geckodriver is in C:\bin and environment variable is set as geckodriver.

The pictures shows the mini script with the error in the settings line.  
 ![pycharm_selenium2library_fehler](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/a2526d86882c4b474a0a316d2d777edca449d7d6.jpeg)

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [3 March 2021 11:28 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/2 "2021-03-03T11:28:26Z")

</div>

First off, do not use “Selenium2Library” - it is nothing but a wrapper that installs SeleniumLibrary. If tutorial is pointing you to use that, its _seriously_ outdated.

1. Replace “Library Selenium2Library” with “Library SeleniumLibrary”.
2. Ensure that you have more than one space between “OpenBrowser”, your url and “Firefox”.

And then report back.

Worth to mention is that What you see as “error” in the IDE might not be an error in robotframework - if your IDE doesn’t use robotframework’s language server protocol, that IDE relies on its own implementation to parse the syntax and can lead to problems within that IDE, not while really executing your resources.

And finally - I’d personally also start thinking about upgrading python to at least 3.7 but that

---

<div class="post-metadata">

**Author:** ![pixelhead](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@pixelhead](https://forum.robotframework.org/u/pixelhead)\
**Post date:** [4 March 2021 12:30 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/3 "2021-03-04T12:30:40Z")

</div>

Thank you very much for your response.

1. I uninstalled selenium2library and installed seleniumLibrary.  
`pip install robotframework-seleniumlibrary`

The pip list now:  
pip (9.0.1)  
robotframework (3.2.2)  
robotframework-pythonlibcore (2.2.1)  
robotframework-selenium2library (3.0.0)  
robotframework-seleniumlibrary (3.3.0)  
selenium (3.141.0)  
setuptools (28.8.0)  
urllib3 (1.26.3)

1. I tried with one and with two spaces between “Open Browser” and “Firefox”. In both cases it is not working. Now the mini script is with two spaces. You wrote “OpenBrowser” and I did “Open Browser” (and tried “OpenBrowser” too) and the documentarty says “Open Browser”. I hope I do get that right).  
[[https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser)]([https://Keyword](https://Keyword) Open Browser in the doumentation.)

What I do not understand is how the SeleniumLibrary is found? Or how the robot farmework is connected? I ask because the failing message to the script after a run in the PyCharm terminal with  
`robot -d results Tests`  
is:  
`[ERROR] Error in file 'C:\Robot\ProjectGoogle\Tests\ErsterFall.robot' on line 2: Non-existing setting 'Library SeleniumLibrary'.`

I did not upgarde the Python version yet. I read it is a bit tricky because of the “Path” viariable in the “environment variable” section of Windows 10. If it is really necessary I surely will try that too. For now I consider such update as a recommentaion and not as an obligation to run a test case.

![pycharm_selenium2library_fehler_2](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/8c55d709e1d09798bfbda507857c0f6d802ff6d3.jpeg)

---

<div class="post-metadata">

**Author:** ![Tualtaim](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/tualtaim/32/546_2.png) [@Tualtaim](https://forum.robotframework.org/u/Tualtaim)\
**Post date:** [4 March 2021 13:19 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/4 "2021-03-04T13:19:24Z")

</div>

> [@pixelhead](#):
>
> `[ERROR] Error in file 'C:\Robot\ProjectGoogle\Tests\ErsterFall.robot' on line 2: Non-existing setting 'Library SeleniumLibrary'.`

When importing a library you need at least two spaces between Library and SeleniumLibrary.

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [4 March 2021 13:23 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/5 "2021-03-04T13:23:08Z")

</div>

> [@pixelhead](#):
>
> Non-existing setting ‘Library SeleniumLibrary’.

It means that you are not writing the code correctly. Maybe you should at least skim the user guide and [Robot Framework User Guide](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#space-separated-format) particular section …

---

<div class="post-metadata">

**Author:** ![pixelhead](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@pixelhead](https://forum.robotframework.org/u/pixelhead)\
**Post date:** [4 March 2021 15:31 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/6 "2021-03-04T15:31:16Z")

</div>

A little progess, thanx!

I still struggle with the geckodriver path.  
`Open Browser http://www.bing.com Firefox`  
Message:  
_WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH._

I tried with this:  
`Set Environment Variable webdriver.geckodriver.driver C:\bin\geckodriver.exe`  
and the message is:  
_No keyword with name ‘Set Environment’ found._

Environment variable is set as geckodriver (See picture). How do I address the driver? What is missing?  
 ![geckodriver_path_1](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/2f1fc70889746a866de7fcbc8e905740d04ce3e8.jpeg)

And thanx for the patience.

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [5 March 2021 09:53 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/7 "2021-03-05T09:53:40Z")

</div>

there’s a variable called PATH, which is a list of directories separated by `;` in windows and `:` in posix like systems (linux, mac).

In windows, if you open “cmd” and write “where geckodriver”, if the location where geckodriver.exe is in the path, you will see something like this:

```python
jani mikkonen@DESKTOP-P3TPBJF D:\omat\seleniumtestability>where geckodriver
D:\omat\seleniumtestability\venv\Scripts\geckodriver.exe

jani mikkonen@DESKTOP-P3TPBJF D:\omat\seleniumtestability>

```

eg, it prints out a full path to where geckodriver is located.

If its not in the PATH, you will see:

```python
INFO: Could not find files for the given pattern(s).

```

So, in your case, if your geckodriver.exe is in `c:\bin`. You should add that to your PATH. Google for “set PATH variable windows” and first entry in the search results will give you exact steps.

Or temporarily, you can add the location to path in same shell you run robot from:

```python
path %PATH%;c:\bin

```

---

<div class="post-metadata">

**Author:** ![pixelhead](https://avatars.discourse-cdn.com/v4/letter/p/90ced4/32.png) [@pixelhead](https://forum.robotframework.org/u/pixelhead)\
**Post date:** [5 March 2021 10:13 UTC](https://forum.robotframework.org/t/selenium2library-does-not-load/1419/8 "2021-03-05T10:13:38Z")

</div>

Yes! Test run complete. Thats it, thank you very much!

I obviously misunderstood the path entry. I listed geckodriver in the list of variables but did not edit the Path entry itself. It worked after restart of PyCharm.

I appreciate it very much that this forum helps on such beginners and newbies questions as well. Thanx again!
