TestNG Parallels

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

TestNG Parallels

JROCK2004

I kick it off and they start running like crazy but the tests start to
fail. If I run the tests one by one they pass. I am starting to think
that the threads are getting messed up. Any ideas?

Here is my xml file

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel RegressionTest Suite" parallel="classes">
        <test name="FireFox Regression Tests">
                <packages>
                        <package name="selenium.tests.acctmgmt" />
                        <package name="selenium.tests.checkout.address" />
                        <package name="selenium.tests.checkout.cart" />
                        <package name="selenium.tests.checkout.payment" />
                        <package name="tests.checkout.paymentmethods" />
                        <package name="selenium.tests.checkout.receipt" />
                        <package name="selenium.tests.checkout.review" />
                        <package name="selenium.tests.checkout.shipping" />
                        <package name="selenium.tests.shopping" />
                </packages>
        </test>
</suite>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

Cédric Beust ♔-2
Most likely, your tests are not thread safe.

I suggest starting by running them all single threaded and then adding one class at a time in the multithreaded section and see if they keep passing.

If they don't, you probably need to add some locking or just run these ones singlethreaded.

--
Cédric


On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]> wrote:

I kick it off and they start running like crazy but the tests start to
fail. If I run the tests one by one they pass. I am starting to think
that the threads are getting messed up. Any ideas?

Here is my xml file

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel RegressionTest Suite" parallel="classes">
       <test name="FireFox Regression Tests">
               <packages>
                       <package name="selenium.tests.acctmgmt" />
                       <package name="selenium.tests.checkout.address" />
                       <package name="selenium.tests.checkout.cart" />
                       <package name="selenium.tests.checkout.payment" />
                       <package name="tests.checkout.paymentmethods" />
                       <package name="selenium.tests.checkout.receipt" />
                       <package name="selenium.tests.checkout.review" />
                       <package name="selenium.tests.checkout.shipping" />
                       <package name="selenium.tests.shopping" />
               </packages>
       </test>
</suite>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JROCK2004
You mean like this

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel RegressionTest Suite" parallel="classes">
        <test name="FireFox Regression Tests">
                <packages>
                        <package name="selenium.tests.acctmgmt" />
                        <package
name="selenium.tests.checkout.address" />
                </packages>
        </test>
</suite>

On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:

> Most likely, your tests are not thread safe.
>
> I suggest starting by running them all single threaded and then adding one
> class at a time in the multithreaded section and see if they keep passing.
>
> If they don't, you probably need to add some locking or just run these ones
> singlethreaded.
>
> --
> Cédric
>
>
>
>
>
> On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]> wrote:
>
> > I kick it off and they start running like crazy but the tests start to
> > fail. If I run the tests one by one they pass. I am starting to think
> > that the threads are getting messed up. Any ideas?
>
> > Here is my xml file
>
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > <suite name="Parallel RegressionTest Suite" parallel="classes">
> >        <test name="FireFox Regression Tests">
> >                <packages>
> >                        <package name="selenium.tests.acctmgmt" />
> >                        <package name="selenium.tests.checkout.address" />
> >                        <package name="selenium.tests.checkout.cart" />
> >                        <package name="selenium.tests.checkout.payment" />
> >                        <package name="tests.checkout.paymentmethods" />
> >                        <package name="selenium.tests.checkout.receipt" />
> >                        <package name="selenium.tests.checkout.review" />
> >                        <package name="selenium.tests.checkout.shipping" />
> >                        <package name="selenium.tests.shopping" />
> >                </packages>
> >        </test>
> > </suite>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> Cédric

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Re: TestNG Parallels

Cédric Beust ♔-2
No, create two <test> sections, one with parallel="classes" and one without parallel. Start by putting all your classes in the latter and then move your classes one by one in the one that's parallel.

--
Cédric


On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
You mean like this

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel RegressionTest Suite" parallel="classes">
       <test name="FireFox Regression Tests">
               <packages>
                       <package name="selenium.tests.acctmgmt" />
                       <package
name="selenium.tests.checkout.address" />
               </packages>
       </test>
</suite>

On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> Most likely, your tests are not thread safe.
>
> I suggest starting by running them all single threaded and then adding one
> class at a time in the multithreaded section and see if they keep passing.
>
> If they don't, you probably need to add some locking or just run these ones
> singlethreaded.
>
> --
> Cédric
>
>
>
>
>
> On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]> wrote:
>
> > I kick it off and they start running like crazy but the tests start to
> > fail. If I run the tests one by one they pass. I am starting to think
> > that the threads are getting messed up. Any ideas?
>
> > Here is my xml file
>
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > <suite name="Parallel RegressionTest Suite" parallel="classes">
> >        <test name="FireFox Regression Tests">
> >                <packages>
> >                        <package name="selenium.tests.acctmgmt" />
> >                        <package name="selenium.tests.checkout.address" />
> >                        <package name="selenium.tests.checkout.cart" />
> >                        <package name="selenium.tests.checkout.payment" />
> >                        <package name="tests.checkout.paymentmethods" />
> >                        <package name="selenium.tests.checkout.receipt" />
> >                        <package name="selenium.tests.checkout.review" />
> >                        <package name="selenium.tests.checkout.shipping" />
> >                        <package name="selenium.tests.shopping" />
> >                </packages>
> >        </test>
> > </suite>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> Cédric

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JROCK2004
Ok so it appears that my threads are not save. Is there a link out
there that can point me to making them safe?

Thanks


On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:

> No, create two <test> sections, one with parallel="classes" and one without
> parallel. Start by putting all your classes in the latter and then move your
> classes one by one in the one that's parallel.
>
> --
> Cédric
>
>
>
>
>
> On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
> > You mean like this
>
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > <suite name="Parallel RegressionTest Suite" parallel="classes">
> >        <test name="FireFox Regression Tests">
> >                <packages>
> >                        <package name="selenium.tests.acctmgmt" />
> >                        <package
> > name="selenium.tests.checkout.address" />
> >                 </packages>
> >        </test>
> > </suite>
>
> > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > Most likely, your tests are not thread safe.
>
> > > I suggest starting by running them all single threaded and then adding
> > one
> > > class at a time in the multithreaded section and see if they keep
> > passing.
>
> > > If they don't, you probably need to add some locking or just run these
> > ones
> > > singlethreaded.
>
> > > --
> > > Cédric
>
> > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]> wrote:
>
> > > > I kick it off and they start running like crazy but the tests start to
> > > > fail. If I run the tests one by one they pass. I am starting to think
> > > > that the threads are getting messed up. Any ideas?
>
> > > > Here is my xml file
>
> > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > >        <test name="FireFox Regression Tests">
> > > >                <packages>
> > > >                        <package name="selenium.tests.acctmgmt" />
> > > >                        <package name="selenium.tests.checkout.address"
> > />
> > > >                        <package name="selenium.tests.checkout.cart" />
> > > >                        <package name="selenium.tests.checkout.payment"
> > />
> > > >                        <package name="tests.checkout.paymentmethods" />
> > > >                        <package name="selenium.tests.checkout.receipt"
> > />
> > > >                        <package name="selenium.tests.checkout.review"
> > />
> > > >                        <package name="selenium.tests.checkout.shipping"
> > />
> > > >                        <package name="selenium.tests.shopping" />
> > > >                </packages>
> > > >        </test>
> > > > </suite>
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "testng-users" group.
> > > > To post to this group, send email to [hidden email].
> > > > To unsubscribe from this group, send email to
> > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > --
> > > Cédric
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> Cédric

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Re: TestNG Parallels

Cédric Beust ♔-2


On Wed, Aug 25, 2010 at 11:53 AM, jrock2004 <[hidden email]> wrote:
Ok so it appears that my threads are not save. Is there a link out
there that can point me to making them safe?

There's a lot of material about Java concurrency, look it up on Google.

If you're looking for some solid material, the book Java Concurrency in Practice is the reference.

Fundamentally, you just need to look at your classes and understand what will happen when two of them run in parallel.

--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Re: TestNG Parallels

Felipe Knorr Kuhn
In reply to this post by JROCK2004
Since you are using Selenium, you are probably having problems with the Selenium server or client objects. At some point they might get messed up.

Pay attention to your setup logic.

I would use @BeforeSuite to start the Selenium server and @BeforeTest to launch a new browser instance

On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]> wrote:
Ok so it appears that my threads are not save. Is there a link out
there that can point me to making them safe?

Thanks


On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> No, create two <test> sections, one with parallel="classes" and one without
> parallel. Start by putting all your classes in the latter and then move your
> classes one by one in the one that's parallel.
>
> --
> Cédric
>
>
>
>
>
> On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
> > You mean like this
>
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > <suite name="Parallel RegressionTest Suite" parallel="classes">
> >        <test name="FireFox Regression Tests">
> >                <packages>
> >                        <package name="selenium.tests.acctmgmt" />
> >                        <package
> > name="selenium.tests.checkout.address" />
> >                 </packages>
> >        </test>
> > </suite>
>
> > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > Most likely, your tests are not thread safe.
>
> > > I suggest starting by running them all single threaded and then adding
> > one
> > > class at a time in the multithreaded section and see if they keep
> > passing.
>
> > > If they don't, you probably need to add some locking or just run these
> > ones
> > > singlethreaded.
>
> > > --
> > > Cédric
>
> > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]> wrote:
>
> > > > I kick it off and they start running like crazy but the tests start to
> > > > fail. If I run the tests one by one they pass. I am starting to think
> > > > that the threads are getting messed up. Any ideas?
>
> > > > Here is my xml file
>
> > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > >        <test name="FireFox Regression Tests">
> > > >                <packages>
> > > >                        <package name="selenium.tests.acctmgmt" />
> > > >                        <package name="selenium.tests.checkout.address"
> > />
> > > >                        <package name="selenium.tests.checkout.cart" />
> > > >                        <package name="selenium.tests.checkout.payment"
> > />
> > > >                        <package name="tests.checkout.paymentmethods" />
> > > >                        <package name="selenium.tests.checkout.receipt"
> > />
> > > >                        <package name="selenium.tests.checkout.review"
> > />
> > > >                        <package name="selenium.tests.checkout.shipping"
> > />
> > > >                        <package name="selenium.tests.shopping" />
> > > >                </packages>
> > > >        </test>
> > > > </suite>
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "testng-users" group.
> > > > To post to this group, send email to [hidden email].
> > > > To unsubscribe from this group, send email to
> > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > --
> > > Cédric
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> Cédric

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JROCK2004
I figured it out. It was the way I was declaring the firefox driver.
Now the code is working. Thanks



On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:

> Since you are using Selenium, you are probably having problems with the
> Selenium server or client objects. At some point they might get messed up.
>
> Pay attention to your setup logic.
>
> I would use @BeforeSuite to start the Selenium server and @BeforeTest to
> launch a new browser instance
>
>
>
> On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]> wrote:
> > Ok so it appears that my threads are not save. Is there a link out
> > there that can point me to making them safe?
>
> > Thanks
>
> > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > No, create two <test> sections, one with parallel="classes" and one
> > without
> > > parallel. Start by putting all your classes in the latter and then move
> > your
> > > classes one by one in the one that's parallel.
>
> > > --
> > > Cédric
>
> > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
> > > > You mean like this
>
> > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > >        <test name="FireFox Regression Tests">
> > > >                <packages>
> > > >                        <package name="selenium.tests.acctmgmt" />
> > > >                        <package
> > > > name="selenium.tests.checkout.address" />
> > > >                 </packages>
> > > >        </test>
> > > > </suite>
>
> > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > Most likely, your tests are not thread safe.
>
> > > > > I suggest starting by running them all single threaded and then
> > adding
> > > > one
> > > > > class at a time in the multithreaded section and see if they keep
> > > > passing.
>
> > > > > If they don't, you probably need to add some locking or just run
> > these
> > > > ones
> > > > > singlethreaded.
>
> > > > > --
> > > > > Cédric
>
> > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]>
> > wrote:
>
> > > > > > I kick it off and they start running like crazy but the tests start
> > to
> > > > > > fail. If I run the tests one by one they pass. I am starting to
> > think
> > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > Here is my xml file
>
> > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > >        <test name="FireFox Regression Tests">
> > > > > >                <packages>
> > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > >                        <package
> > name="selenium.tests.checkout.address"
> > > > />
> > > > > >                        <package name="selenium.tests.checkout.cart"
> > />
> > > > > >                        <package
> > name="selenium.tests.checkout.payment"
> > > > />
> > > > > >                        <package
> > name="tests.checkout.paymentmethods" />
> > > > > >                        <package
> > name="selenium.tests.checkout.receipt"
> > > > />
> > > > > >                        <package
> > name="selenium.tests.checkout.review"
> > > > />
> > > > > >                        <package
> > name="selenium.tests.checkout.shipping"
> > > > />
> > > > > >                        <package name="selenium.tests.shopping" />
> > > > > >                </packages>
> > > > > >        </test>
> > > > > > </suite>
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > > > Groups
> > > > > > "testng-users" group.
> > > > > > To post to this group, send email to [hidden email]
> > .
> > > > > > To unsubscribe from this group, send email to
> > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > .
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > --
> > > > > Cédric
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "testng-users" group.
> > > > To post to this group, send email to [hidden email].
> > > > To unsubscribe from this group, send email to
> > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > --
> > > Cédric
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JROCK2004
Ok so now I got things working but I have noticed that I get a lot of
false negatives on my tests. Example is that it cannot find and
element on the page or something. But if I run that one test by itself
it passes.


So I guess what I am getting at, What is the best way to debug with
you are running tests in parallel? Thanks




On Aug 27, 8:32 am, jrock2004 <[hidden email]> wrote:

> I figured it out. It was the way I was declaring the firefox driver.
> Now the code is working. Thanks
>
> On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:
>
>
>
> > Since you are using Selenium, you are probably having problems with the
> > Selenium server or client objects. At some point they might get messed up.
>
> > Pay attention to your setup logic.
>
> > I would use @BeforeSuite to start the Selenium server and @BeforeTest to
> > launch a new browser instance
>
> > On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]> wrote:
> > > Ok so it appears that my threads are not save. Is there a link out
> > > there that can point me to making them safe?
>
> > > Thanks
>
> > > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > No, create two <test> sections, one with parallel="classes" and one
> > > without
> > > > parallel. Start by putting all your classes in the latter and then move
> > > your
> > > > classes one by one in the one that's parallel.
>
> > > > --
> > > > Cédric
>
> > > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
> > > > > You mean like this
>
> > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > >        <test name="FireFox Regression Tests">
> > > > >                <packages>
> > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > >                        <package
> > > > > name="selenium.tests.checkout.address" />
> > > > >                 </packages>
> > > > >        </test>
> > > > > </suite>
>
> > > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > Most likely, your tests are not thread safe.
>
> > > > > > I suggest starting by running them all single threaded and then
> > > adding
> > > > > one
> > > > > > class at a time in the multithreaded section and see if they keep
> > > > > passing.
>
> > > > > > If they don't, you probably need to add some locking or just run
> > > these
> > > > > ones
> > > > > > singlethreaded.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]>
> > > wrote:
>
> > > > > > > I kick it off and they start running like crazy but the tests start
> > > to
> > > > > > > fail. If I run the tests one by one they pass. I am starting to
> > > think
> > > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > > Here is my xml file
>
> > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > > >        <test name="FireFox Regression Tests">
> > > > > > >                <packages>
> > > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.address"
> > > > > />
> > > > > > >                        <package name="selenium.tests.checkout.cart"
> > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.payment"
> > > > > />
> > > > > > >                        <package
> > > name="tests.checkout.paymentmethods" />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.receipt"
> > > > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.review"
> > > > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.shipping"
> > > > > />
> > > > > > >                        <package name="selenium.tests.shopping" />
> > > > > > >                </packages>
> > > > > > >        </test>
> > > > > > > </suite>
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the Google
> > > > > Groups
> > > > > > > "testng-users" group.
> > > > > > > To post to this group, send email to [hidden email]
> > > .
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "testng-users" group.
> > > > > To post to this group, send email to [hidden email].
> > > > > To unsubscribe from this group, send email to
> > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > --
> > > > Cédric
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Re: TestNG Parallels

Felipe Knorr Kuhn
How are you instantiating your selenium objects?

I still think some of your tests might be using the same instance.

FK

On Mon, Aug 30, 2010 at 12:27 PM, jrock2004 <[hidden email]> wrote:
Ok so now I got things working but I have noticed that I get a lot of
false negatives on my tests. Example is that it cannot find and
element on the page or something. But if I run that one test by itself
it passes.


So I guess what I am getting at, What is the best way to debug with
you are running tests in parallel? Thanks




On Aug 27, 8:32 am, jrock2004 <[hidden email]> wrote:
> I figured it out. It was the way I was declaring the firefox driver.
> Now the code is working. Thanks
>
> On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:
>
>
>
> > Since you are using Selenium, you are probably having problems with the
> > Selenium server or client objects. At some point they might get messed up.
>
> > Pay attention to your setup logic.
>
> > I would use @BeforeSuite to start the Selenium server and @BeforeTest to
> > launch a new browser instance
>
> > On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]> wrote:
> > > Ok so it appears that my threads are not save. Is there a link out
> > > there that can point me to making them safe?
>
> > > Thanks
>
> > > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > No, create two <test> sections, one with parallel="classes" and one
> > > without
> > > > parallel. Start by putting all your classes in the latter and then move
> > > your
> > > > classes one by one in the one that's parallel.
>
> > > > --
> > > > Cédric
>
> > > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]> wrote:
> > > > > You mean like this
>
> > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > >        <test name="FireFox Regression Tests">
> > > > >                <packages>
> > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > >                        <package
> > > > > name="selenium.tests.checkout.address" />
> > > > >                 </packages>
> > > > >        </test>
> > > > > </suite>
>
> > > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > Most likely, your tests are not thread safe.
>
> > > > > > I suggest starting by running them all single threaded and then
> > > adding
> > > > > one
> > > > > > class at a time in the multithreaded section and see if they keep
> > > > > passing.
>
> > > > > > If they don't, you probably need to add some locking or just run
> > > these
> > > > > ones
> > > > > > singlethreaded.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <[hidden email]>
> > > wrote:
>
> > > > > > > I kick it off and they start running like crazy but the tests start
> > > to
> > > > > > > fail. If I run the tests one by one they pass. I am starting to
> > > think
> > > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > > Here is my xml file
>
> > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > > >        <test name="FireFox Regression Tests">
> > > > > > >                <packages>
> > > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.address"
> > > > > />
> > > > > > >                        <package name="selenium.tests.checkout.cart"
> > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.payment"
> > > > > />
> > > > > > >                        <package
> > > name="tests.checkout.paymentmethods" />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.receipt"
> > > > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.review"
> > > > > />
> > > > > > >                        <package
> > > name="selenium.tests.checkout.shipping"
> > > > > />
> > > > > > >                        <package name="selenium.tests.shopping" />
> > > > > > >                </packages>
> > > > > > >        </test>
> > > > > > > </suite>
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the Google
> > > > > Groups
> > > > > > > "testng-users" group.
> > > > > > > To post to this group, send email to [hidden email]
> > > .
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "testng-users" group.
> > > > > To post to this group, send email to [hidden email].
> > > > > To unsubscribe from this group, send email to
> > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > --
> > > > Cédric
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JROCK2004
This is what I have to start the browser.

private WebDriver getBrowserInstance()
    {
        WebDriver driverInstance = null;
        System.out.println("[INFO] BROWSER: "
        + TestUtilities.browserType.toUpperCase() + " " +
TestUtilities.browserVersion);
        if (TestUtilities.browserType.equals("firefox")) {
        String profile = TestUtilities.firefoxProfile;
        if (profile == null)
        {
        System.err.println("[WARNING] SYSTEM PROPERTY
'webdriver.firefox.profile' NOT SET. USING \"default\".");
        profile = "default";
        }
        System.out.println("[INFO] Profile: [" + profile + "]");
        ProfilesIni allProfiles = new ProfilesIni();
        FirefoxProfile ffprofile = allProfiles.getProfile(profile);
        ffprofile.setEnableNativeEvents(false);
        ffprofile.setAcceptUntrustedCertificates(false);
        FirefoxDriver browserFF = new FirefoxDriver(ffprofile);

                driverInstance = browserFF;

                 return driverInstance;
    }

On Aug 30, 11:46 am, Felipe Knorr Kuhn <[hidden email]> wrote:

> How are you instantiating your selenium objects?
>
> I still think some of your tests might be using the same instance.
>
> FK
>
>
>
> On Mon, Aug 30, 2010 at 12:27 PM, jrock2004 <[hidden email]> wrote:
> > Ok so now I got things working but I have noticed that I get a lot of
> > false negatives on my tests. Example is that it cannot find and
> > element on the page or something. But if I run that one test by itself
> > it passes.
>
> > So I guess what I am getting at, What is the best way to debug with
> > you are running tests in parallel? Thanks
>
> > On Aug 27, 8:32 am, jrock2004 <[hidden email]> wrote:
> > > I figured it out. It was the way I was declaring the firefox driver.
> > > Now the code is working. Thanks
>
> > > On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:
>
> > > > Since you are using Selenium, you are probably having problems with the
> > > > Selenium server or client objects. At some point they might get messed
> > up.
>
> > > > Pay attention to your setup logic.
>
> > > > I would use @BeforeSuite to start the Selenium server and @BeforeTest
> > to
> > > > launch a new browser instance
>
> > > > On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]>
> > wrote:
> > > > > Ok so it appears that my threads are not save. Is there a link out
> > > > > there that can point me to making them safe?
>
> > > > > Thanks
>
> > > > > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > No, create two <test> sections, one with parallel="classes" and one
> > > > > without
> > > > > > parallel. Start by putting all your classes in the latter and then
> > move
> > > > > your
> > > > > > classes one by one in the one that's parallel.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]>
> > wrote:
> > > > > > > You mean like this
>
> > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > > >        <test name="FireFox Regression Tests">
> > > > > > >                <packages>
> > > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > > >                        <package
> > > > > > > name="selenium.tests.checkout.address" />
> > > > > > >                 </packages>
> > > > > > >        </test>
> > > > > > > </suite>
>
> > > > > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > > > Most likely, your tests are not thread safe.
>
> > > > > > > > I suggest starting by running them all single threaded and then
> > > > > adding
> > > > > > > one
> > > > > > > > class at a time in the multithreaded section and see if they
> > keep
> > > > > > > passing.
>
> > > > > > > > If they don't, you probably need to add some locking or just
> > run
> > > > > these
> > > > > > > ones
> > > > > > > > singlethreaded.
>
> > > > > > > > --
> > > > > > > > Cédric
>
> > > > > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <
> > [hidden email]>
> > > > > wrote:
>
> > > > > > > > > I kick it off and they start running like crazy but the tests
> > start
> > > > > to
> > > > > > > > > fail. If I run the tests one by one they pass. I am starting
> > to
> > > > > think
> > > > > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > > > > Here is my xml file
>
> > > > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > > > <suite name="Parallel RegressionTest Suite"
> > parallel="classes">
> > > > > > > > >        <test name="FireFox Regression Tests">
> > > > > > > > >                <packages>
> > > > > > > > >                        <package
> > name="selenium.tests.acctmgmt" />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.address"
> > > > > > > />
> > > > > > > > >                        <package
> > name="selenium.tests.checkout.cart"
> > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.payment"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="tests.checkout.paymentmethods" />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.receipt"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.review"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.shipping"
> > > > > > > />
> > > > > > > > >                        <package
> > name="selenium.tests.shopping" />
> > > > > > > > >                </packages>
> > > > > > > > >        </test>
> > > > > > > > > </suite>
>
> > > > > > > > > --
> > > > > > > > > You received this message because you are subscribed to the
> > Google
> > > > > > > Groups
> > > > > > > > > "testng-users" group.
> > > > > > > > > To post to this group, send email to
> > [hidden email]
> > > > > .
> > > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > > > .
> > > > > > > > > For more options, visit this group at
> > > > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > > > --
> > > > > > > > Cédric
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> > Google
> > > > > Groups
> > > > > > > "testng-users" group.
> > > > > > > To post to this group, send email to
> > [hidden email].
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "testng-users" group.
> > > > > To post to this group, send email to [hidden email].
> > > > > To unsubscribe from this group, send email to
> > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Re: TestNG Parallels

Felipe Knorr Kuhn
And when is that method called?

If you were running just one thread, I would recommend you to start your browser in a @BeforeSuite method.

Reading your first post, you are running the classes in parallel, so perhaps you should use a @BeforeClass method to launch it and a @AfterClass method to kill it.

FK

On Mon, Aug 30, 2010 at 1:59 PM, jrock2004 <[hidden email]> wrote:
This is what I have to start the browser.

private WebDriver getBrowserInstance()
   {
       WebDriver driverInstance = null;
       System.out.println("[INFO] BROWSER: "
                       + TestUtilities.browserType.toUpperCase() + " " +
TestUtilities.browserVersion);
       if (TestUtilities.browserType.equals("firefox")) {
               String profile = TestUtilities.firefoxProfile;
               if (profile == null)
               {
                       System.err.println("[WARNING] SYSTEM PROPERTY
'webdriver.firefox.profile' NOT SET. USING \"default\".");
                       profile = "default";
               }
               System.out.println("[INFO] Profile: [" + profile + "]");
               ProfilesIni allProfiles = new ProfilesIni();
               FirefoxProfile ffprofile = allProfiles.getProfile(profile);
               ffprofile.setEnableNativeEvents(false);
               ffprofile.setAcceptUntrustedCertificates(false);
               FirefoxDriver browserFF = new FirefoxDriver(ffprofile);

               driverInstance = browserFF;

                return driverInstance;
   }

On Aug 30, 11:46 am, Felipe Knorr Kuhn <[hidden email]> wrote:
> How are you instantiating your selenium objects?
>
> I still think some of your tests might be using the same instance.
>
> FK
>
>
>
> On Mon, Aug 30, 2010 at 12:27 PM, jrock2004 <[hidden email]> wrote:
> > Ok so now I got things working but I have noticed that I get a lot of
> > false negatives on my tests. Example is that it cannot find and
> > element on the page or something. But if I run that one test by itself
> > it passes.
>
> > So I guess what I am getting at, What is the best way to debug with
> > you are running tests in parallel? Thanks
>
> > On Aug 27, 8:32 am, jrock2004 <[hidden email]> wrote:
> > > I figured it out. It was the way I was declaring the firefox driver.
> > > Now the code is working. Thanks
>
> > > On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:
>
> > > > Since you are using Selenium, you are probably having problems with the
> > > > Selenium server or client objects. At some point they might get messed
> > up.
>
> > > > Pay attention to your setup logic.
>
> > > > I would use @BeforeSuite to start the Selenium server and @BeforeTest
> > to
> > > > launch a new browser instance
>
> > > > On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]>
> > wrote:
> > > > > Ok so it appears that my threads are not save. Is there a link out
> > > > > there that can point me to making them safe?
>
> > > > > Thanks
>
> > > > > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > No, create two <test> sections, one with parallel="classes" and one
> > > > > without
> > > > > > parallel. Start by putting all your classes in the latter and then
> > move
> > > > > your
> > > > > > classes one by one in the one that's parallel.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]>
> > wrote:
> > > > > > > You mean like this
>
> > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > > >        <test name="FireFox Regression Tests">
> > > > > > >                <packages>
> > > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > > >                        <package
> > > > > > > name="selenium.tests.checkout.address" />
> > > > > > >                 </packages>
> > > > > > >        </test>
> > > > > > > </suite>
>
> > > > > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > > > Most likely, your tests are not thread safe.
>
> > > > > > > > I suggest starting by running them all single threaded and then
> > > > > adding
> > > > > > > one
> > > > > > > > class at a time in the multithreaded section and see if they
> > keep
> > > > > > > passing.
>
> > > > > > > > If they don't, you probably need to add some locking or just
> > run
> > > > > these
> > > > > > > ones
> > > > > > > > singlethreaded.
>
> > > > > > > > --
> > > > > > > > Cédric
>
> > > > > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <
> > [hidden email]>
> > > > > wrote:
>
> > > > > > > > > I kick it off and they start running like crazy but the tests
> > start
> > > > > to
> > > > > > > > > fail. If I run the tests one by one they pass. I am starting
> > to
> > > > > think
> > > > > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > > > > Here is my xml file
>
> > > > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > > > <suite name="Parallel RegressionTest Suite"
> > parallel="classes">
> > > > > > > > >        <test name="FireFox Regression Tests">
> > > > > > > > >                <packages>
> > > > > > > > >                        <package
> > name="selenium.tests.acctmgmt" />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.address"
> > > > > > > />
> > > > > > > > >                        <package
> > name="selenium.tests.checkout.cart"
> > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.payment"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="tests.checkout.paymentmethods" />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.receipt"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.review"
> > > > > > > />
> > > > > > > > >                        <package
> > > > > name="selenium.tests.checkout.shipping"
> > > > > > > />
> > > > > > > > >                        <package
> > name="selenium.tests.shopping" />
> > > > > > > > >                </packages>
> > > > > > > > >        </test>
> > > > > > > > > </suite>
>
> > > > > > > > > --
> > > > > > > > > You received this message because you are subscribed to the
> > Google
> > > > > > > Groups
> > > > > > > > > "testng-users" group.
> > > > > > > > > To post to this group, send email to
> > [hidden email]
> > > > > .
> > > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > > > .
> > > > > > > > > For more options, visit this group at
> > > > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > > > --
> > > > > > > > Cédric
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> > Google
> > > > > Groups
> > > > > > > "testng-users" group.
> > > > > > > To post to this group, send email to
> > [hidden email].
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > --
> > > > > > Cédric
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "testng-users" group.
> > > > > To post to this group, send email to [hidden email].
> > > > > To unsubscribe from this group, send email to
> > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > <testng-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: TestNG Parallels

JohnMc-3
In reply to this post by JROCK2004
The way I make sure that my WebDriver instance is thread safe is to
declare it as below:

        private ThreadLocal<WebDriver> driver = new
ThreadLocal<WebDriver>();

        protected void setDriver(WebDriver driver)
        {
                this.driver.set(driver);
        }

        private WebDriver driver()
        {
                return driver.get();
        }


I had the same problems as you and this now works perfectly.

On Aug 31, 2:59 am, jrock2004 <[hidden email]> wrote:

> This is what I have to start the browser.
>
> private WebDriver getBrowserInstance()
>     {
>         WebDriver driverInstance = null;
>         System.out.println("[INFO] BROWSER: "
>                         + TestUtilities.browserType.toUpperCase() + " " +
> TestUtilities.browserVersion);
>         if (TestUtilities.browserType.equals("firefox")) {
>                 String profile = TestUtilities.firefoxProfile;
>                 if (profile == null)
>                 {
>                         System.err.println("[WARNING] SYSTEM PROPERTY
> 'webdriver.firefox.profile' NOT SET. USING \"default\".");
>                         profile = "default";
>                 }
>                 System.out.println("[INFO] Profile: [" + profile + "]");
>                 ProfilesIni allProfiles = new ProfilesIni();
>                 FirefoxProfile ffprofile = allProfiles.getProfile(profile);
>                 ffprofile.setEnableNativeEvents(false);
>                 ffprofile.setAcceptUntrustedCertificates(false);
>                 FirefoxDriver browserFF = new FirefoxDriver(ffprofile);
>
>                 driverInstance = browserFF;
>
>                  return driverInstance;
>     }
>
> On Aug 30, 11:46 am, Felipe Knorr Kuhn <[hidden email]> wrote:
>
> > How are you instantiating your selenium objects?
>
> > I still think some of your tests might be using the same instance.
>
> > FK
>
> > On Mon, Aug 30, 2010 at 12:27 PM, jrock2004 <[hidden email]> wrote:
> > > Ok so now I got things working but I have noticed that I get a lot of
> > > false negatives on my tests. Example is that it cannot find and
> > > element on the page or something. But if I run that one test by itself
> > > it passes.
>
> > > So I guess what I am getting at, What is the best way to debug with
> > > you are running tests in parallel? Thanks
>
> > > On Aug 27, 8:32 am, jrock2004 <[hidden email]> wrote:
> > > > I figured it out. It was the way I was declaring the firefox driver.
> > > > Now the code is working. Thanks
>
> > > > On Aug 25, 3:07 pm, Felipe Knorr Kuhn <[hidden email]> wrote:
>
> > > > > Since you are using Selenium, you are probably having problems with the
> > > > > Selenium server or client objects. At some point they might get messed
> > > up.
>
> > > > > Pay attention to your setup logic.
>
> > > > > I would use @BeforeSuite to start the Selenium server and @BeforeTest
> > > to
> > > > > launch a new browser instance
>
> > > > > On Wed, Aug 25, 2010 at 3:53 PM, jrock2004 <[hidden email]>
> > > wrote:
> > > > > > Ok so it appears that my threads are not save. Is there a link out
> > > > > > there that can point me to making them safe?
>
> > > > > > Thanks
>
> > > > > > On Aug 25, 2:26 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > > No, create two <test> sections, one with parallel="classes" and one
> > > > > > without
> > > > > > > parallel. Start by putting all your classes in the latter and then
> > > move
> > > > > > your
> > > > > > > classes one by one in the one that's parallel.
>
> > > > > > > --
> > > > > > > Cédric
>
> > > > > > > On Wed, Aug 25, 2010 at 11:22 AM, jrock2004 <[hidden email]>
> > > wrote:
> > > > > > > > You mean like this
>
> > > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > > <suite name="Parallel RegressionTest Suite" parallel="classes">
> > > > > > > >        <test name="FireFox Regression Tests">
> > > > > > > >                <packages>
> > > > > > > >                        <package name="selenium.tests.acctmgmt" />
> > > > > > > >                        <package
> > > > > > > > name="selenium.tests.checkout.address" />
> > > > > > > >                 </packages>
> > > > > > > >        </test>
> > > > > > > > </suite>
>
> > > > > > > > On Aug 25, 2:14 pm, Cédric Beust ♔ <[hidden email]> wrote:
> > > > > > > > > Most likely, your tests are not thread safe.
>
> > > > > > > > > I suggest starting by running them all single threaded and then
> > > > > > adding
> > > > > > > > one
> > > > > > > > > class at a time in the multithreaded section and see if they
> > > keep
> > > > > > > > passing.
>
> > > > > > > > > If they don't, you probably need to add some locking or just
> > > run
> > > > > > these
> > > > > > > > ones
> > > > > > > > > singlethreaded.
>
> > > > > > > > > --
> > > > > > > > > Cédric
>
> > > > > > > > > On Wed, Aug 25, 2010 at 10:29 AM, jrock2004 <
> > > [hidden email]>
> > > > > > wrote:
>
> > > > > > > > > > I kick it off and they start running like crazy but the tests
> > > start
> > > > > > to
> > > > > > > > > > fail. If I run the tests one by one they pass. I am starting
> > > to
> > > > > > think
> > > > > > > > > > that the threads are getting messed up. Any ideas?
>
> > > > > > > > > > Here is my xml file
>
> > > > > > > > > > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > > > > > > > > > <suite name="Parallel RegressionTest Suite"
> > > parallel="classes">
> > > > > > > > > >        <test name="FireFox Regression Tests">
> > > > > > > > > >                <packages>
> > > > > > > > > >                        <package
> > > name="selenium.tests.acctmgmt" />
> > > > > > > > > >                        <package
> > > > > > name="selenium.tests.checkout.address"
> > > > > > > > />
> > > > > > > > > >                        <package
> > > name="selenium.tests.checkout.cart"
> > > > > > />
> > > > > > > > > >                        <package
> > > > > > name="selenium.tests.checkout.payment"
> > > > > > > > />
> > > > > > > > > >                        <package
> > > > > > name="tests.checkout.paymentmethods" />
> > > > > > > > > >                        <package
> > > > > > name="selenium.tests.checkout.receipt"
> > > > > > > > />
> > > > > > > > > >                        <package
> > > > > > name="selenium.tests.checkout.review"
> > > > > > > > />
> > > > > > > > > >                        <package
> > > > > > name="selenium.tests.checkout.shipping"
> > > > > > > > />
> > > > > > > > > >                        <package
> > > name="selenium.tests.shopping" />
> > > > > > > > > >                </packages>
> > > > > > > > > >        </test>
> > > > > > > > > > </suite>
>
> > > > > > > > > > --
> > > > > > > > > > You received this message because you are subscribed to the
> > > Google
> > > > > > > > Groups
> > > > > > > > > > "testng-users" group.
> > > > > > > > > > To post to this group, send email to
> > > [hidden email]
> > > > > > .
> > > > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > > > > .
> > > > > > > > > > For more options, visit this group at
> > > > > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > > > > --
> > > > > > > > > Cédric
>
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the
> > > Google
> > > > > > Groups
> > > > > > > > "testng-users" group.
> > > > > > > > To post to this group, send email to
> > > [hidden email].
> > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > > > .
> > > > > > > > For more options, visit this group at
> > > > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > > > > > --
> > > > > > > Cédric
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > > "testng-users" group.
> > > > > > To post to this group, send email to [hidden email].
> > > > > > To unsubscribe from this group, send email to
> > > > > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > <testng-users%2Bunsubscribe@google groups.com>
> > > > > > .
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/testng-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.