How to get the version number of the used Selenium2Library

3,472 views
Skip to first unread message

mr

unread,
Sep 24, 2013, 4:19:43 AM9/24/13
to robotframe...@googlegroups.com
Hi!

how can I get the version number of the currently used Selenium2Library?

Regards

Kevin O.

unread,
Sep 25, 2013, 12:47:42 AM9/25/13
to robotframe...@googlegroups.com
The version is stored in a  __version__ attribute of the module (the standard way).

From Python:
>>> import Selenium2Library
>>> Selenium2Library.__version__
'1.2.0'
>>>

From Robot Framework:
${selenium2library version}=    Evaluate    Selenium2Library.__version__    Selenium2Library

Kevin O.

unread,
Sep 25, 2013, 12:59:25 AM9/25/13
to robotframe...@googlegroups.com
Woah, please disregard that last post. Here is the more proper way that works across both the Python and Java versions where applicable...

${selenium2library}= Get Library Instance Selenium2Library
${selenium2library version}= Set Variable ${selenium2library.ROBOT_LIBRARY_VERSION}

From Python/Jython:
from robot.libraries.BuiltIn import Builtin

def get_selenium2library_version():
    return BuiltIn.get_library_instance('Selenium2Library').__version__

From Java:
import Selenium2Library;

public SomeClass {
    public String getSelenium2LibraryVersion() {
        return Selenium2Library.ROBOT_LIBRARY_VERSION;
    }
}

Kevin O.

unread,
Sep 25, 2013, 1:00:10 AM9/25/13
to robotframe...@googlegroups.com
Darnit,
return BuiltIn.get_library_instance('Selenium2Library').__version__
should be
return BuiltIn().get_library_instance('Selenium2Library').__version__

JMJ

unread,
Oct 26, 2015, 7:45:44 AM10/26/15
to robotframework-users
From the Windows Command Line:
python -m robot.libdoc Selenium2Library version 

PMadasu

unread,
Dec 11, 2017, 8:30:40 AM12/11/17
to robotframework-users
On windows, open Command prompt  and simply type below command it displays as below:

pip freeze | grep selenium

C:\Python27\Scripts>pip freeze | grep selenium
robotframework-selenium2library==1.8.0
selenium==3.4.3

satyaki majumder

unread,
Apr 6, 2020, 11:34:05 AM4/6/20
to robotframework-users
Hi, this is not recognized as internal or external command
Reply all
Reply to author
Forward
0 new messages