Running tests in parrallel mode

21 views
Skip to first unread message

Abaxaba

unread,
Mar 2, 2011, 10:51:22 AM3/2/11
to cubictest-users
I use junit for run cubictest tests inparralel mode (maven-surefire-
plugin).
I use java.util.Set of SelenumRunner(s) for run tests in parallel.
When they are running there are many errors.
I have a question: I think these errors happen when I reuse old
runner even it is free. But if I create new SeleniumRunner for each
test the browsers they are open are don't closes and I have too many
open browser windows. Can I use something to close browser after the
runner.run(String s) method? And is it ok to run tests in parallel
mode.
It's a goo plugin but I need to run tests in parallel to reduse time
they executing ~40min.

Maybe someone have a practice to run the tests using SeleniumRunner
in parralel mode ?

Thanks!

Christian Schwarz

unread,
Mar 2, 2011, 2:44:19 PM3/2/11
to cubicte...@googlegroups.com
You will have to try this out yourself.

If it does not work out, try splitting up the suite into many sub modules that might be able to run i parallell.

C.

2011/3/2 Abaxaba <ig...@lionhearth.com>

Abaxaba

unread,
Mar 3, 2011, 12:00:41 AM3/3/11
to cubictest-users
Thanks Cristian for the fast answer.

I've looked at CubicTest source code and firured out some thougth.

Oh. I want to share my solution to run tests in parallel:

I've replaced selenium-server to the last version using maven:
<dependency>
<groupId>org.cubictest</groupId>
<artifactId>cubictest</artifactId>
<version>2.0.3</version>
</dependency>

<dependency>
<groupId>org.cubictest</groupId>
<artifactId>selenium-exporter</artifactId>
<version>2.0.3</version>
</dependency>

<!--<dependency>-->
<!--<groupId>org.cubictest</groupId>-->
<!--<artifactId>cubictest-selenium-rc</artifactId>-->
<!--<version>2.0.3</version>-->
<!--</dependency>-->

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-control</artifactId>
<version>2.0b2</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.0b2</version>
</dependency>


And it was the solution to run selenium normally and close browser
when SeleniumRunner finishes.

For now I create new SeleniumRunner for each test.

But also there was a problem with SameVMCustomTestStepConverter.java.
There is static final Map:

private static final ThreadLocal<IElementContext> threadElementContext
= new ThreadLocal<IElementContext>();

And we can't use this feature if we run tests in parallel.

So I want to suggest some modification to the CubicTest Project:
1. Use Maven For CubicTest project . It's really good practice.
2. Make threadElementContext not final & static. And give access for
this context from SeleniumRunner.
3. Update selenium to the Latest version.

Also our team can participate in developing your CubicTest project.
We use CubicTest in our project and it can help the CubicTest for
growth.

On Mar 3, 3:44 am, Christian Schwarz <srz.christ...@gmail.com> wrote:
> You will have to try this out yourself.
>
> If it does not work out, try splitting up the suite into many sub modules
> that might be able to run i parallell.
>
> C.
>
> 2011/3/2 Abaxaba <i...@lionhearth.com>

Christian Schwarz

unread,
Mar 3, 2011, 7:02:49 AM3/3/11
to cubicte...@googlegroups.com
Great.

I suggest you fork cubictest on github
https://github.com/cubictest/cubictest
and send pull requests so that I can merge changes into the main repo.

ThreadLocal on ElementContext should work as long as seperate theads are used. I think it should stay that way... or please explain why not :-)

C.

2011/3/3 Abaxaba <ig...@lionhearth.com>
Reply all
Reply to author
Forward
0 new messages