multiple test cases on one browser instance

416 views
Skip to first unread message

dave

unread,
Nov 16, 2010, 3:51:46 PM11/16/10
to Selenium Users
Is there a way to, I guess by calling setUp() and tearDown() only
once, which I don't think is available "out of the box", to run
multiple test cases on one browser instance?

Test A run on browser A
Test B run on browser A where Test A left off
...

etc.

Felipe Knorr Kuhn

unread,
Nov 16, 2010, 3:59:26 PM11/16/10
to seleniu...@googlegroups.com
Dave,

Take a look at TestNG instead of JUnit.

I have written a blog post about it a while ago, which might help you: http://knorrium.info/2010/08/31/using-testng-to-launch-your-tests-and-the-selenium-server/

FK


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Shaba K

unread,
Nov 17, 2010, 8:24:43 AM11/17/10
to seleniu...@googlegroups.com
Dave,
 
It's an excellent post ..
 
But the question here is to continue test B  from where  test A is completed.
 
In my case as i have built each testcase scenario based so for each test you have to
 
for ex :
1.Main page has links for each flow
2.Add user
3.Modify user
4.Delete user.
 
so for each flow i will have to go to main page & start over all again.
 
If there a easy approach please suggest so that could reduce a few lines of code.
 
 
 
-Shabana

dave

unread,
Nov 17, 2010, 3:54:50 PM11/17/10
to Selenium Users
Well, my ultimate goal is to have even more flexibility. And If
possible, I'd like to continue in Python (i.e. inheriting the Python
module unittest). Establishing a Java framework is good and all (and
if this proves impossible, probably what I will have to do) but I'd
like to work with Python RC if possible.

With that being said, unittest and Selenium seems to run def setUp()
and def tearDown() at the begininng and end of each test case.

Here is ultimately what I'd like to do:

Establish setUp() and tearDown() in separate "call-once" classes,
possibly running with a thread. (possibly).

run test cases in between. Also a HUGE factor that is necessary is to
be able to have Selenium recognize different browser instances...
Meaning, I have a browser open from some previous test or whatever,
and run a separate test case and NOT OPEN A NEW BROWSER, but instead,
recognize the currently open browsers. Maybe even search all open
browsers and see if maybe the one I want is present.
The logic of this is similar to QTP:
Browser("name:='The Browser Title'").Page("hi
there").Link("name:=link1").click

That's what I'd like to achieve. And I'm not sure TestNG achieves this
either. Also, it doesn't provide the FULL flexibility I'd like. For
example if I'd like to run only Test case 1,2,3 today and 1,3 tomorrow
and be able to achieve this customized run simply by modifying a
simple "Driver" file.

For most test automation tools, I'd usually have to write 3rd party
tools or scripts to achieve this anyways...

On Nov 16, 3:59 pm, Felipe Knorr Kuhn <fkn...@gmail.com> wrote:
> Dave,
>
> Take a look at TestNG instead of JUnit.
>
> I have written a blog post about it a while ago, which might help you:http://knorrium.info/2010/08/31/using-testng-to-launch-your-tests-and...
>
> FK
>
> On Tue, Nov 16, 2010 at 6:51 PM, dave <davidrey...@gmail.com> wrote:
> > Is there a way to, I guess by calling setUp() and tearDown() only
> > once, which I don't think is available "out of the box", to run
> > multiple test cases on one browser instance?
>
> > Test A run on browser A
> > Test B run on browser A where Test A left off
> > ...
>
> > etc.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> > .

dave

unread,
Nov 17, 2010, 3:55:10 PM11/17/10
to Selenium Users
> Dave,
>
> Take a look at TestNG instead of JUnit.
>
> I have written a blog post about it a while ago, which might help you:http://knorrium.info/2010/08/31/using-testng-to-launch-your-tests-and...
>
> FK
>
> On Tue, Nov 16, 2010 at 6:51 PM, dave <davidrey...@gmail.com> wrote:
> > Is there a way to, I guess by calling setUp() and tearDown() only
> > once, which I don't think is available "out of the box", to run
> > multiple test cases on one browser instance?
>
> > Test A run on browser A
> > Test B run on browser A where Test A left off
> > ...
>
> > etc.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages