1
votes

I want to use keywords written in DateTime Library http://robotframework.googlecode.com/hg/doc/libraries/DateTime.html?r=2.8.5

I have robot framework 2.8.6.

Whenever I import this library in my tests in RIDE; it is shown in red (not resolved). Also in documentation I am not able to search the keywords.

3
What programming language are you so ng? Could you add a tag? - Yulia V
How are you importing DateTime? It should just be |Library|DateTime| | | - Paul Hicks
I have imported it as follows - *** Settings *** Library DateTime - Snehal Gokhale
With a single space between Library and DateTime or double space. It would be useful if you at least add the code that you are trying. - Vimalraj Selvam

3 Answers

2
votes

Your problem is probably with RIDE and not Robot Framework. RIDE uses its own copy of RF regardless of what you have installed. The included version is out of date. Try copying DateTime.py from Robot Framework installation to the folder in RIDE.

For example, copy C:\apps\Python27\Lib\site-packages\robot\libraries\DateTime.py to C:\apps\Python27\Lib\site-packages\robotide\lib\robot\libraries

Then restart RIDE.

0
votes

ombre42 is right, RIDE (my current is 1.3.0) includes an older version of RobotFramework which does not includes DateTime module. You have the RobotFramework 2.8.6 installed, but you doesn't use it when you launch tests using RobotFramework-RIDE.

Two important things:

  1. Copy DateTime.py from your RobotFramework 2.8.6 as ombre42 said, but don't import DateTime using pip: it will work but you'll not get the RobotFramework's one (which is better and documented).
  2. When you run your tests outside of RIDE, in a Jenkins environment for example, you'll probably use the RobotFramework 2.8.6 (or later) and not the same as your RIDE environment.
0
votes

I'm use RF with Python and by default my IDE sees Python DateTime library. Use full path:

Library           robot.libraries.DateTime