2

So, I'm working on a robotframework test project, and the goal is to run several test suites in parallel. For this purpose, pabot was chosen as the solution. I am trying to implement it, but with little success.

My issue is: after installing Pabot (which, I might say, I did by cloning the project and running "setup.py install", instead of using pip, since the corporate proxy I'm behind has proven an obstacle I can't overcome), I created a new directory in the project tree, moved some suites there, and ran:

pabot --processes 2 --outputdir pabot_results Login*.robot

Doing so results in the following error message:

enter image description here

2018-10-10 10:27:30.449000 [PID:9676] [0] EXECUTING Suites.LoginAdmin

2018-10-10 10:27:30.449000 PID:400 EXECUTING Suites.LoginUser

2018-10-10 10:27:30.777000 PID:400 FAILED Suites.LoginUser

2018-10-10 10:27:30.777000 [PID:9676] [0] FAILED Suites.LoginAdmin

WARN: No output files in "pabot_results\pabot_results" Output: [ ERROR ] Reading XML source '' failed: invalid mode ('rb') or filename

Try --help for usage information. Elapsed time: 0 minutes 0.578 seconds

Upon inspecting the stderr file that was generated, I have this message:

enter image description here

Traceback (most recent call last): File "C:\Python27\Lib\site-packages\robotframework-3.1a2.dev1-py2.7.egg\robot\running\runner.py", line 22, in from .context import EXECUTION_CONTEXTS ValueError: Attempted relative import in non-package

Apparently, this has to do with something from the runner.py script, which, if I'm not mistaken, came with the installation of robotframework. Since manually modifying that script does not seem to me the optimal solution, my question is, what am I missing here? Did I forget to do anything while setting this up? Or is this an issue of compatibility between versions?

This project is using Maven as the tool to manage dependencies. The version I am running is 3.5.4. I am using a Windows 10, 64bit system; I have Python 2.7.14, and Robot Framework 3.1a2.dev1. The Pabot version is 0.44. Obviously, I added C:\Python27 and C:\Python27\Scripts to the PATH environment variable.

Edit: I am also using robotframework-maven-plugin version 1.4.0.8, if that happens to be relevant. Edit 2: added the error messages in text format.

fp25
  • 135
  • 2
  • 11
  • Did you try to install using pip but from local directory? https://stackoverflow.com/a/20043907/9999810 – JaPyR Oct 10 '18 at 10:57
  • yes, but I failed for the same reason... So, if I just download get-pip.py and run it from the command line, I have a message saying Collecting pip, and then I have the same network connection error that I can't make go away even if I add the proxy options (i.e., running python get-pip.py --proxy http://user:password@proxyserver:port) – fp25 Oct 10 '18 at 11:36
  • But isn't pip shipped by default with the most recent version of python? – JaPyR Oct 10 '18 at 11:38
  • I don't think so, since, if I try to run "pip install X", I get this message: 'pip' is not recognized as an internal or external command, operable program or batch file. – fp25 Oct 10 '18 at 11:47
  • Please take the time to copy, paste, and format the error messages rather than posting screenshots. Screenshots are hard to read, aren't searchable, and can't be copy/pasted. – Bryan Oakley Oct 10 '18 at 11:59
  • Noted, I will edit the post right now. I just thought that this way was easier to visualize. – fp25 Oct 10 '18 at 12:02

3 Answers3

4

I believe I've come across an issue similar when setting up parallel execution on my machine. Firstly I would confirm that pabot is installed using pip show robotframework-pabot.

Then you should define the directory your results are going to using -d. I then modified the name of the -o to Output.xml to make it easy to identify.

This is a copy of the code I use. Runs optimally with 8 processes

pabot --processes 8 -d results -o Output.xml Tests

KeithMc18
  • 112
  • 2
  • 10
  • That's the thing, I installed pabot, but I downloaded the zipped folder, and then ran setup.py via command line. I'm not having much success in using pip at all, for the reasons I explained, and so I can't use your line to check the pabot installation... – fp25 Oct 10 '18 at 15:07
  • Have you tried uninstalling PIP and then reinstalling it? that could potentially solve it. – KeithMc18 Oct 10 '18 at 15:19
  • That's the thing, I don't have pip installed, for the reasons I explained above... Even with the proxy settings in the command line, I can't make it work through the firewall. I installed robotframework and everything else the same way: downloading the zipped folder, extracting it, then running install setup.py in the directory. Robotframework does work... – fp25 Oct 10 '18 at 16:00
  • Is there a reason your using python 2.7? Its possible that uninstalling that and installing a newer version could solve your issue. – KeithMc18 Oct 11 '18 at 07:28
  • 1
    I'm using Python 2.7 because a) I didn't start this project, I just "inherited" it, and b) I'm under the impression that some robotframework-related things are still not fully compatible with Python 3. However, I'm going to try it, and if it works, I'll post it as an answer. – fp25 Oct 11 '18 at 12:31
1

Seems that you stumbled on a bug in the prerelease version of robot framework (3.1a2.dev1). Please install a release version of robot framework. For example 3.0.4.

mkorpela
  • 4,317
  • 2
  • 19
  • 21
  • That indeed solved the error I was having, but right now my issue is that, when I try to run the pabot command I described above, I get this error: [ ERROR ] Error in file '(...)\src\test\robotframework\try\LoginAdmin.robot': Importing test library 'Selenium2Library' failed: ImportError: No module named SeleniumLibrary File "build\bdist.win-amd64\egg\Selenium2Library\__init__.py", line 19, in Apparently, this issue is easily solvable with pip, which I, apparently, still can't use. Is there a way to add the necessary module(s) without pip? – fp25 Oct 15 '18 at 14:56
0

Just in case anyone happens to stumble upon this issue in the future:

Since I can't use pip, and I tried a good deal of workarounds that eventually made things more unstable, I ended up saving my project and removing everything Python-related from my system, so as to allow me to install everything from scratch. In a Windows 10, 64bit system, I used:

  • Python 2.7.14

  • wxPython 2.8.12.1, win64, unicode, for py27

  • setuptools 40.2.0 (to allow me to use the easy_install command)

  • Robot Framework 3.0.4

  • robotremoteserver 1.1

  • Selenium2Library 3.0.0

  • and Pabot version 0.45.

I might add that, when installing the Selenium2Library the way I described above, it eventually tries to download some things from the pip repositories - which, if you have a proxy, will cause you trouble. I solved this problem by browsing https://pypi.org/simple/selenium/, manually downloading the 2.53.6 .tar.gz file, then extracting it and running setup.py install on the command line.

PS: Ideally, though, anyone should be able to use proxy settings from the command line (--proxy http://user:password@server:port) to get pip and then use it; however, for some reason, probably related to network security configurations that I didn't want to lose time with, this didn't work in my case.

fp25
  • 135
  • 2
  • 11