Question

i am using Python, and Selenium Webdriver. I have a set of testCases wrapped inside a testSuite, and I want them to be run in parallel regardless of their testCase configurations (some of them are to be run locally, and some of them will run via saucelabs).

I've come across this page. This one should be a killer, but it just cannot run correctly on my unit. I tried running the code, installed the twisted.python (prerequisite of the script), zope-interface (prerequisite of twisted.python), but i got these following errors:

Unhandled Error
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 524, in __bootstrap
    self.__bootstrap_inner()
  File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted\python\threadpool.py", line 172, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext
    return func(*args,**kw)
exceptions.TypeError: 'NoneType' object is not callable

I just cannot detect the problem.

Maybe someone has already tried the script and it works? or if there are any of you who have tried conducting parallel testing the unittest.TestSuite with other methods please share it with me! I've already spent weeks working around SauceLabs's recommendation wd.parallel.. The example parallel testing code at saucelabs doesn't work with my unit, as i am currently running 2.7.3 (a required version by our team), and the need to add a decorator @wd.parallel.multiply above the runTest() and tearDown() method declarations should not be an option since i am creating a script that should be useable by future webdriver testCases easily, and would just run them in just a few lines of code.

Was it helpful?

Solution

You might take a look at nose, which has a multiprocessing plugin for running Python tests in parallel: https://nose.readthedocs.org/en/latest/plugins/multiprocess.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top