Richard
Richard

Reputation: 15

Unable to run parallel robotframework tests using pabot in pycharm

So, fairly new to robot framework. Using Pycharm, I have created a test suite which has two directories. One for test scripts and one for resource files. The tests all run fine sequentially, when using:

robot test_directory

or

pybot test_directory

I need to now run them in parallel. I have found and installed pabot using:

pip install -U robotframework-pabot

In the Pycharm terminal I run the following:

pabot test_directory

I get the following error:

**

Traceback (most recent call last):
  File "C:\Python\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Python\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Python\lib\site-packages\pabot\__init__.py", line 1, in <module>
    from .PabotLib import PabotLib
  File "C:\Python\lib\site-packages\pabot\PabotLib.py", line 22, in <module>
    from robotremoteserver import RobotRemoteServer
  File "C:\Python\lib\site-packages\robotremoteserver.py", line 103
    except (OSError, select.error), err:
                                  ^
SyntaxError: invalid syntax

**

I have also tried:

pabot test_directory *.robot

pabot test.robot

pabot test_directory test.robot

I am using RF 3.0.2, Python 3.6

Can anyone point out what I am doing wrong and point me in the right direction?

Upvotes: 1

Views: 2532

Answers (3)

Upkar Singh
Upkar Singh

Reputation: 19

So what you can do is, try below command

pabot --processes 2 test_directory.robot

It will create 2 threads which will run in parallel.

Upvotes: 0

mkorpela
mkorpela

Reputation: 4395

Seems you are executing an old version on RobotRemoteServer. Please do pip install robotremoteserver==1.1

Upvotes: 0

Verv
Verv

Reputation: 2473

As stated in the error message, it's invalid Python syntax. The reason for this is, Pabot, like many other modules and libraries of Robot Framework's ecosystem, hasn't been upgraded to be compatible with Python 3 yet.

To fix this particular error, you'd need to change:

except (OSError, select.error), err:

To this:

except (OSError, select.error) as err:

Although you should note that the module may have some more Python 3 incompatibilities and if you don't absolutely need to use Python 3, you might want to consider using Python 2.7.x

If going back to Python 2.7 isn't an option, you could consider fixing Pabot's Python 3 incompatibilities and submitting a pull request on it's Github repository

Upvotes: 2

Related Questions