Robot Framework test run from Jenkins. - No module named robot

361 views
Skip to first unread message

Robert Szabo

unread,
Jul 22, 2020, 12:20:23 PM7/22/20
to Jenkins Users
Hi,

Jenkins cant run my Robot Framework test cases.

I run this job in Execute Windows batch command

cd C:\work\robot\Es1P\
set PYTHONPATH=C:\Users\robert.szabo\AppData\Roaming\Python\Python37\Scripts
echo %PYTHONPATH%
python.exe -m robot C:\work\robot\Es1P
echo Completed


Jenkins run of it always fails, console output is this:

-----------------------------------------------------------------
Console Output
Started by user admin
Running as SYSTEM
Building in workspace C:\Program Files (x86)\Jenkins\workspace\r1
[r1] $ cmd /c call C:\windows\TEMP\jenkins1877465942945470142.bat

C:\Program Files (x86)\Jenkins\workspace\r1>cd C:\work\robot\Es1P\ 

C:\work\robot\Es1P>set PYTHONPATH=C:\Users\robert.szabo\AppData\Roaming\Python\Python37\Scripts 

C:\work\robot\Es1P>echo C:\Users\robert.szabo\AppData\Roaming\Python\Python37\Scripts 
C:\Users\robert.szabo\AppData\Roaming\Python\Python37\Scripts

C:\work\robot\Es1P>python.exe -m robot C:\work\robot\Es1P 
C:\Program Files\Python37\python.exe: No module named robot

C:\work\robot\Es1P>echo Completed 
Completed

C:\work\robot\Es1P>exit 1 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

-------------------------------------------------------------------------------------

checking robot location in Powershell 

(get-command robot.exe).Path

PS C:\work\robot\Es1P> (get-command robot.exe).Path
C:\Users\robert.szabo\AppData\Roaming\Python\Python37\Scripts\robot.exe


So i think PYTHONPATH should work, but seems not.

Eric Pyle

unread,
Jul 24, 2020, 9:48:18 AM7/24/20
to jenkins...@googlegroups.com
I wonder if this is because AppData is a hidden folder, and/or not accessible to the user running Jenkins. Can you try a directory listing of that Scripts directory in a Jenkins job batch command?

Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/63d9fc16-cdd1-4db1-bb3e-cbb5908ddb83o%40googlegroups.com.

Slide

unread,
Jul 24, 2020, 11:03:27 AM7/24/20
to Jenkins User Mailing List
My guess is that Jenkins (either the agent or server) is running as a different user, so the module isn't installed for that user. You show "robert.szabo" for where robot.exe is installed, but is that the user that Jenkins is running as on that system?



--
Reply all
Reply to author
Forward
0 new messages