Jybot/Pybot problems

4,435 views
Skip to first unread message

Paweł Marek

unread,
Mar 1, 2012, 4:54:22 AM3/1/12
to robotframework-users
Hi All,

I would like try to use SSH library for my Robot Framework and connect
with db to perform some tests. But I encountered some problems with
jybot and pybot also. I done all instructions from here:
http://code.google.com/p/robotframework-sshlibrary/wiki/InstallationInstructions

(I have installed robot, ride, ssh library, pycrypto and paramiko
also)

However I'm still getting some errors (both with jybot and pybot).

When I've started my test with jybot, I have following error:

working directory: C:\Python27\Scripts
command: jybot.bat --argumentfile c:\users\pmare\appdata\local\temp
\RIDEg9wq6p.d\argfile.txt --listener C:\Python27\lib\site-packages
\robotide\contrib\testrunner\SocketListener.py:5010 C:\Users\pmare
\Desktop\Warsztaty2\warsztaty2.tsv
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\runner.py", line 317, in
<module>
import robot
ImportError: No module named robot

test finished 03/01/12 10:49:13

And with pybot I have following error:

working directory: C:\Python27\Scripts
command: pybot.bat --argumentfile c:\users\pmare\appdata\local\temp
\RIDEg9wq6p.d\argfile.txt --listener C:\Python27\lib\site-packages
\robotide\contrib\testrunner\SocketListener.py:5010 C:\Users\pmare
\Desktop\Warsztaty2\warsztaty2.tsv
[ ERROR ] Error in file 'C:\Users\pmare\Desktop
\Warsztaty2\resources.tsv' in table 'Setting': Importing test library
'org.robot.database.keywords.DatabaseLibrary' failed: ImportError: No
module named org.robot.database.keywords
Traceback (most recent call last):
None
PYTHONPATH:
C:\Python27\lib\site-packages\robot\libraries
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
C:\Python27\lib\site-packages\win32
C:\Python27\lib\site-packages\win32\lib
C:\Python27\lib\site-packages\Pythonwin
C:\Python27\lib\site-packages\wx-2.8-msw-unicode
.
==========================================================================================
Warsztaty2
==========================================================================================
1
| FAIL |
Setup failed:
No keyword with name 'connect to database' found.
------------------------------------------------------------------------------------------
Warsztaty2
| FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==========================================================================================
Output: c:\users\pmare\appdata\local\temp\RIDEg9wq6p.d\output.xml
Log: c:\users\pmare\appdata\local\temp\RIDEg9wq6p.d\log.html
Report: c:\users\pmare\appdata\local\temp\RIDEg9wq6p.d\report.html

test finished 03/01/12 10:51:04

I check couple of sites and I can't find solution for my problems. I
know that for jython/pybot I need also appropriate path configuration.
Currently my ptah looks that:

C:\Python27\Scripts\ ; C:\jython2.5.2; C:\jython2.5.2\bin; C:
\jython2.5.2\jython.jar; %JYTHON_HOME%\bin; C:\Python27\Lib\site-
packages\robot

Maybe someone also had similar problems and can give my some tips
here?

Thanks

Pekka Klärck

unread,
Mar 1, 2012, 5:35:12 AM3/1/12
to pawelm...@gmail.com, robotframework-users
2012/3/1 Paweł Marek <pawelm...@gmail.com>:

>
> When I've started my test with jybot, I have following error:
>
> working directory: C:\Python27\Scripts
> command: jybot.bat --argumentfile c:\users\pmare\appdata\local\temp
> \RIDEg9wq6p.d\argfile.txt --listener C:\Python27\lib\site-packages
> \robotide\contrib\testrunner\SocketListener.py:5010 C:\Users\pmare
> \Desktop\Warsztaty2\warsztaty2.tsv
> Traceback (most recent call last):
>  File "C:\Python27\lib\site-packages\robot\runner.py", line 317, in
> <module>
>    import robot
> ImportError: No module named robot

It seems that Jython does not find Robot installation. Does `jybot
--version` work?

> And with pybot I have following error:
>
> working directory: C:\Python27\Scripts
> command: pybot.bat --argumentfile c:\users\pmare\appdata\local\temp
> \RIDEg9wq6p.d\argfile.txt --listener C:\Python27\lib\site-packages
> \robotide\contrib\testrunner\SocketListener.py:5010 C:\Users\pmare
> \Desktop\Warsztaty2\warsztaty2.tsv
> [ ERROR ] Error in file 'C:\Users\pmare\Desktop
> \Warsztaty2\resources.tsv' in table 'Setting': Importing test library
> 'org.robot.database.keywords.DatabaseLibrary' failed: ImportError: No
> module named org.robot.database.keywords

This error is caused by you trying to use Java based database library
on Python. This will not work directly, but the latest version of the
library ought to support remote library interface that allows you to
use it also from Python. Alternatively you can try the Python based
database library that is available here:
http://franz-see.github.com/Robotframework-Database-Library/

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Pawel

unread,
Mar 1, 2012, 5:50:51 AM3/1/12
to robotframework-users
Hi Pekka,

I installed jython (in version 2.5.2 in following localisation: C:
\jython2.5.2), however I don't know why when I'm trying jybot --
version in console I get message:

C:\Users\pmare>jybot --version
'jybot' is not recognized as an internal or external command,
operable program or batch file.

I don't know what is going on, but maybe there is something in my
path?

Pawel


On 1 Mar, 11:35, Pekka Klärck <p...@iki.fi> wrote:
> 2012/3/1 Paweł Marek <pawelmare...@gmail.com>:

Pekka Klärck

unread,
Mar 1, 2012, 6:20:59 AM3/1/12
to pawelm...@gmail.com, robotframework-users
2012/3/1 Pawel <pawelm...@gmail.com>:

> Hi Pekka,
>
> I installed jython (in version 2.5.2 in following localisation: C:
> \jython2.5.2), however I don't know why when I'm trying jybot --
> version in console I get message:
>
> C:\Users\pmare>jybot --version
> 'jybot' is not recognized as an internal or external command,
> operable program or batch file.
>
> I don't know what is going on, but maybe there is something in my
> path?

If you have installed RF 2.6.x or used Windows installer, then jybot
script should have been created during Robot installation. It ought to
be located in Scripts directory under Python installation next to
pybot script. If running `pybot --version` works, then also jybot
should be found. Successfully running jybot would require Jython to be
in PATH, but if that was the problem you would get a different error.

If you are using RF 2.7 pre-releases and didn't use Windows installer,
then you need to install Robot separately with Jython. In that case
jybot script ought to be created into bin directory under Jython
installation. Installation changes in RF 2.7 are not fully documented
yet but there is some more information here:
http://code.google.com/p/robotframework/wiki/NewInstallation

Pawel

unread,
Mar 1, 2012, 7:20:16 AM3/1/12
to robotframework-users
Hi Pakka,

I have installed RF version 2.7a1, but as I remember during
installation I've used Windows installer. I checked my bin directory
(in C:\jython2.5.2\bin), and in such directory there is only
jython.bat file.

I don't know exactly what I should do with it.

Pawel


On 1 Mar, 12:20, Pekka Klärck <p...@iki.fi> wrote:
> 2012/3/1 Pawel <pawelmare...@gmail.com>:

Pekka Klärck

unread,
Mar 1, 2012, 8:11:19 AM3/1/12
to pawelm...@gmail.com, robotframework-users
2012/3/1 Pawel <pawelm...@gmail.com>:

>
> I have installed RF version 2.7a1, but as I remember during
> installation I've used Windows installer. I checked my bin directory
> (in C:\jython2.5.2\bin), and in such directory there is only
> jython.bat file.

First of all, if you are already in 2.7 you should upgrade to the beta
2 release. Second, the jybot.bat script created by Windows installer
ought to be in Scripts directory under Python installation.

If you don't get this working with RF 2.7, I recommend you to
uninstall it and install 2.6.3. It's installation is documented very
thoroughly in the 2.6.3 User Guide:
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.6.3#installation-and-uninstallation

Pawel

unread,
Mar 1, 2012, 8:23:27 AM3/1/12
to robotframework-users
Sorry for my mistake I thought that ou mentioned about bin directory
under jython directory. In my python folder there is a file jybot.bat
(my localisation: \Python27\Scripts\jybot.bat).

But when I'm trying open that file by commend:

C:\Python27\Scripts>jybot.bat
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\runner.py", line 317, in
<module>
import robot
ImportError: No module named robot

I have error as previous.

Have you ever saw such similar situation?

Pawel

On 1 Mar, 14:11, Pekka Klärck <p...@iki.fi> wrote:
> 2012/3/1 Pawel <pawelmare...@gmail.com>:
>
>
>
> > I have installed RF version 2.7a1, but as I remember during
> > installation I've used Windows installer. I checked my bin directory
> > (in C:\jython2.5.2\bin), and in such directory there is only
> > jython.bat file.
>
> First of all, if you are already in 2.7 you should upgrade to the beta
> 2 release. Second, the jybot.bat script created by Windows installer
> ought to be in Scripts directory under Python installation.
>
> If you don't get this working with RF 2.7, I recommend you to
> uninstall it and install 2.6.3. It's installation is documented very
> thoroughly in the 2.6.3 User Guide:http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkU...

Pekka Klärck

unread,
Mar 1, 2012, 8:29:38 AM3/1/12
to pawelm...@gmail.com, robotframework-users
2012/3/1 Pawel <pawelm...@gmail.com>:

> Sorry for my mistake I thought that ou mentioned about bin directory
> under jython directory. In my python folder there is a file jybot.bat
> (my localisation: \Python27\Scripts\jybot.bat).
>
> But when I'm trying open that file by commend:
>
> C:\Python27\Scripts>jybot.bat
> Traceback (most recent call last):
>  File "C:\Python27\lib\site-packages\robot\runner.py", line 317, in
> <module>
>    import robot
> ImportError: No module named robot
>
> I have error as previous.
>
> Have you ever saw such similar situation?

Are you still using RF 2.7 alpha 1? I wouldn't be surprised if it had
some bugs like this. Please upgrade to RF 2.7 beta 2 or downgrade to
RF 2.6.3.

Hansie

unread,
Jul 12, 2012, 7:28:20 AM7/12/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
I am facing exactly the same problem. I am using RF 2.7.2 version. I am trying to run my script using jybot as i have java libraries but it is throwing an error like "jython is not recognized as internal or external command". Like you mentioned earlier, i checked scripts directory under python installation directory and i do have jybot.bat. When i run this, it is also throwing "jython is not recognized as internal or external command".

Can you please help me with this?

Thanks!

Kevin O.

unread,
Jul 12, 2012, 8:59:49 AM7/12/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
If you can't start the Jython CLI by simply typing jython at the command prompt, then that script is not going to work. You may have to add the jython installation folder or the bin subfolder to the PATH.

Hansie

unread,
Jul 13, 2012, 6:19:53 AM7/13/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
I installed Jython and added the jython as well as jython/bin folder to the path. It is still saying "Importing test library 'helloworld' failed: ImportError: No module named helloworld" when i am trying to run using pybot

but If i use jybot to run, it is unable to recognize some of the selenium library keywords that i am using and neither is it able to identify the custom java library

Kevin O.

unread,
Jul 13, 2012, 8:42:41 AM7/13/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
The value for library must be either a fully qualified class name if the class is on the CLASSPATH or a relative path to the .java or .class file (.class file required as RF does not compile Java source).
If you go the first rout, then after you set the CLASSPATH, you can try to do java com.company.TestLib.  You should get a java.lang.NoSuchMethodError: main error as opposed to a ClassNotFound exception.  This tells you that your CLASSPATH is correct and RF should find the class.
You will never be able to import local Java libraries when executing under pybot as there is no JVM. There is always the option of making the library remote.
There are known compatibilities between Selenium and Jython.  Some people have worked with alphas of a new version of Jython, but using Selenium under Jython is not possible with current release versions.

Hansie

unread,
Jul 16, 2012, 7:53:00 AM7/16/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
I set the class path to where my class file is present and now it is working fine.

On a side note, i was looking for using java remote library and create my own extended java library. I followed the steps in the following url
http://code.google.com/p/jrobotremoteserver/wiki/RemoteServerDetails

I included my helloworld class in the jrobotremoteserver-1.0.jar file but the problem is i do not know how to access the keywords present in helloworld.

I started the server and i ran the test and within the test, called the keyword "display" which is implemented in helloworld. It is throwing "no keyword display"

Please help!

Kevin O.

unread,
Jul 16, 2012, 12:50:50 PM7/16/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
If you using RIDE, keep in mind it does not show you errors when importing a library - you have to look in Tools > View RIDE Log...
That is the first place I would look.
I suspect get_keyword_names is throwing an exception you should see in the aforementioned log.  If it is not, maybe your keyword is implemented in a super class?
jrobotremoteserver uses getDeclaredMethods [1] on the class you pass to it in order to find keywords. This will not find methods in any super classes.

FYI I am working on a new version of jrobotremoteserver [2], but I haven't released any binaries (beta later this week if I can find the time).


Good luck,
Kevin

Hansie

unread,
Jul 17, 2012, 2:00:34 AM7/17/12
to robotframe...@googlegroups.com, pawelm...@gmail.com
Thanks Kevin.Yes, it is giving an error in get_keyword_names. Can you please let me know how to proceed from here? Should I be waiting for the new version of jremoteserver?

Also, am i using the correct way of calling the methods in my custom library?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages