Welcome to RobotAnt project

17 views
Skip to first unread message

Laurent Carbonnaux

unread,
Dec 7, 2010, 6:35:16 PM12/7/10
to robotframework-ANT-users
Welcome to RobotAnt project

RobotAnt is a ant task for using robotframework inside ant build
scripts.

RobotAnt ant task inherits from the core java task.

RobotAnt uses the same parameters and specific ones as robotframework
frequently used options

Visit http://code.google.com/p/robotframework-ant/

Laurent.

ricardo milheiro

unread,
Dec 13, 2010, 12:25:21 PM12/13/10
to robotframework-ant-users
Hello,

I've been trying to use ANT with ROBOT and i've not been able to.
The robot script is a .txt , which is called by a .bat file which
contains no more than "pybot sample.txt". Running only the bat file ,
the tests in robot , without using ANT run well.
When i try to run the same from ANT (the code from the ANT script -
build.xml - is ):

-------------------
build.xml----------------------------------------------------------
<project name="test" default="start">
<!-- Optional tasks -->
<taskdef name="robotant"
classname="org.lcx.robotframework.ant.RobotAnt" classpath="ant-
robotframework-0.1.jar" />

<target name="start"
description="START ROBOT TEST" >
<robotant
jar="robotframework-2.5.4.1.jar"
data_sources="sample.txt"
>
</robotant>
</target>
</project>
--------------------------------------------------------------------
--- sample.txt ---------------------------
-----------------------------------------------------------------------
***Settings***
Library AutoItLibrary
Library tnmscLib

***Test Cases***
Happy Count
Double Count
Double Count
clear_counter2

Launch Core
${obj} = StartTNMSCClient
Set Suite Variable ${obj}
Show Network Subview
showNetworkView ${obj}
Set to Edit TAB
viewEditTAB
Create NE Container

Run Keyword And Ignore Error createNEContainer ${obj} MSI1 ""
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Create NE Container
Run Keyword And Ignore Error createNEContainer ${obj} MSI2 ""
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error createNEContainer ${obj} MSI3 ""
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error createNEContainer ${obj} MSI2 ""
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error createNEContainer ${obj} MSI5 ""
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Modify NE Container
Run Keyword And Ignore Error ModifyNEContainer ${obj} MSI1 line2
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error ModifyNEContainer ${obj} MSI2 line2
"" "" "" C:\\WINDOWS\\temp\\save1.txt
Delete NE Container
Run Keyword And Ignore Error DeleteNEContainer ${obj} MSI1 C:\
\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error DeleteNEContainer ${obj} MSI2 C:\
\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error DeleteNEContainer ${obj} MSI3 C:\
\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error DeleteNEContainer ${obj} MSI4 C:\
\WINDOWS\\temp\\save1.txt
Run Keyword And Ignore Error DeleteNEContainer ${obj} MSI5 C:\
\WINDOWS\\temp\\save1.txt

***Keywords***

Double Count
count
count
-------------------------------------------------------------------------------

To run, i type : ant

It returns a lot of errors in the report log.html:
It seems that the main problems are the libraries AutoItLibrary and
tnmsclib that it cannot find , but the paths of those libraries are in
PITHONPATH.


start:
[robotant] [ ERROR ] Invalid syntax in file 'd:\subversion
\tnms_automation\core
\test1\sample.txt' in table 'Settings': Importing test library
'AutoItLibrary' f
ailed: ImportError: No module named AutoItLibrary
[robotant] PYTHONPATH: ['D:\\subversion\\TNMS_AUTOMATION\\CORE\\test1\
\robotfra
mework-2.5.4.1.jar\\Lib\\robot\\libraries', 'D:\\subversion\
\TNMS_AUTOMATION\\CO
RE\\test1\\Lib', 'D:\\subversion\\TNMS_AUTOMATION\\CORE\\test1\
\robotframework-2
.5.4.1.jar\\Lib', '__classpath__', '__pyclasspath__/', 'D:\\subversion\
\TNMS_AUT
OMATION\\CORE\\corelib', 'C:\\Python26\\Lib\\site-packages\
\AutoItLibrary', '.']

[robotant] CLASSPATH: D:\subversion\TNMS_AUTOMATION\CORE
\test1\robotframework-2
.5.4.1.jar
[robotant] Traceback (most recent call last):
[robotant] File "D:\subversion\TNMS_AUTOMATION\CORE
\test1\robotframework-2.5.
4.1.jar\Lib\robot\utils\importing$py.class", line 94, in _import
[robotant] [ ERROR ] Invalid syntax in file 'd:\subversion
\tnms_automation\core
\test1\sample.txt' in table 'Settings': Importing test library
'tnmscLib' failed
: ImportError: No module named win32com
[robotant] PYTHONPATH: ['D:\\subversion\\TNMS_AUTOMATION\\CORE\\test1\
\robotfra
mework-2.5.4.1.jar\\Lib\\robot\\libraries', 'D:\\subversion\
\TNMS_AUTOMATION\\CO
RE\\test1\\Lib', 'D:\\subversion\\TNMS_AUTOMATION\\CORE\\test1\
\robotframework-2
.5.4.1.jar\\Lib', '__classpath__', '__pyclasspath__/', 'D:\\subversion\
\TNMS_AUT
OMATION\\CORE\\corelib', 'C:\\Python26\\Lib\\site-packages\
\AutoItLibrary', '.']

Laurent Carbonnaux

unread,
Dec 13, 2010, 12:38:38 PM12/13/10
to robotframewo...@googlegroups.com
Hi Ricardo,

It seams this is coming from PYTHONPATH that is not taken into account by the ant task.
I'll check and let you know.

Laurent.

2010/12/13 ricardo milheiro <ricardo....@gmail.com>

Laurent Carbonnaux

unread,
Dec 13, 2010, 4:24:09 PM12/13/10
to robotframewo...@googlegroups.com
Hi Ricardo,

RobotAnt is using well PYTHON_PATH.
I have change the PYTHON_PATH to C:\\Python26\\Lib\\site-packages and have now the following error :  ImportError: No module named win32api
I have found that AutoItLibrary is using win32api that is a compiled fil under ...Lib\site-packages\win32
And it seams that it is not usable under java. win32api.pyd.

Since RobotAnt is using standalone jar of robotframework under java, it may not work.

RobotAnt is doing the same as using robotframework standalone version : see http://code.google.com/p/robotframework/wiki/JavaIntegration
So if you try to run your test with it, it should work with Ant.

Unfortunately my poor knowledge in Python may not help your more than that.
You may request the same on robotframework user group : http://groups.google.com/group/robotframework-users

Regards,
Laurent.



2010/12/13 Laurent Carbonnaux <laurent.c...@gmail.com>
Reply all
Reply to author
Forward
0 new messages