Running Parallel Test on One Machine with Multiple instance of Firefox

9,644 views
Skip to first unread message

Nivrutti

unread,
Aug 2, 2013, 10:34:23 AM8/2/13
to seleniu...@googlegroups.com
I want to run or execute my test scripts on One or single Machine with Multiple instance of Firefox.
Also guide me if we can run parallel test on multiple instance e.g. 4 instance of IE or Chrome browser.

Could you please share the configuration required to do this?
I have done following configuration: I have creaded cmd file for HUB, Node1 and Node2 on single machine.  

Hub:
java -jar selenium-server-standalone-2.31.0.jar -role hub 
Node1:
java -jar selenium-server-standalone-2.31.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 7575 -browser browserName=firefox,version=18.0,maxInstances=5,platform=WINDOWS
Node2:
java -jar selenium-server-standalone-2.31.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 8585 -browser browserName=firefox,version=18.0,maxInstances=5,platform=WINDOWS


Following capability configuration done to execute script on Firefox:

DesiredCapabilities capability = DesiredCapabilities.firefox();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub" capability);
capability.setBrowserName("firefox");
capability.setPlatform(Platform.WINDOWS);
driver.get("http://www.google.co.in/?gws_rd=cr");


This launches only one instance of Firefox. 
I want to execute multiple instance of Firefox to execute my test. Please help me in this.

What is the expected output? What do you see instead?
Parallel test / multiple instance of browser should run or execute on single machine.

Selenium version:2.31
OS:WINDOWS
Browser:Firefox
Browser version:18.0

Krishnan Mahadevan

unread,
Aug 2, 2013, 10:38:43 AM8/2/13
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/04f30695-700f-457a-b181-f3a6d25689ca%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

robbiewinston

unread,
Aug 2, 2013, 12:33:47 PM8/2/13
to seleniu...@googlegroups.com
Grid does not make your tests parallel.  You have to run your tests in parallel in order to take advantage of Grid.  

How you run tests in parallel depends on the test framework you use

Vikram

unread,
Sep 26, 2013, 6:53:03 AM9/26/13
to seleniu...@googlegroups.com
Hi Krishnan,

Thanks for the detailed blog.   Still I've few questions unanswered

  Single Machine

  1.  your blog solution can be used to certify a website on multiple browsers right ?

  2.  can't Grid be used for this purpose ?  

  3. when to go for Grid approach vs solution given in your blog ?

  4.  can I use this method to divide test cases and run them on multiple instances of same browser ?  e.g. total 90 cases , 30 each running on chrome1 , chrome 2 and chrome 3

  Multiple Machine

  1. if  single machine is powerful enough to support X number of test cases run simultaneously on 3 different browsers , then when to go for multiple machine approach ?


  Please share your good practices wrt parallel / distributed

   Thanks in advance.

Regards,
Vikram

Krishnan Mahadevan

unread,
Sep 26, 2013, 10:12:00 PM9/26/13
to seleniu...@googlegroups.com
Answers inline

Thanks and Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

From: Vikram <vikra...@gmail.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Thursday, 26 September 2013 4:23 PM
To: <seleniu...@googlegroups.com>
Subject: Re: [selenium-users] Running Parallel Test on One Machine with Multiple instance of Firefox

Hi Krishnan,

Thanks for the detailed blog.   Still I've few questions unanswered

  Single Machine

  1.  your blog solution can be used to certify a website on multiple browsers right ?

>>>> It was more aimed at showing you the approach on how to achieve parallelism. But yes, you should be able to leverage it for multiple browsers.


  2.  can't Grid be used for this purpose ?  
>>>> Parallelism is something that your TestRunner would be giving you [ Junit (or) TestNG]. Grid is merely a remote execution environment. But yes, you can very well alter the samples in that post to leverage RemoteWebDriver as well.


  3. when to go for Grid approach vs solution given in your blog ?

>>>> Like I said before you can choose either Grid (RemoteWebDriver) (or) the other WebDriver flavours. Parallel executions don't have anything to do with this [ Except for IE wherein I guess concurrent IE executions on a local machine are known to cause un-predictable behaviour ]


  4.  can I use this method to divide test cases and run them on multiple instances of same browser ?  e.g. total 90 cases , 30 each running on chrome1 , chrome 2 and chrome 3
>>> And what would you achieve by doing this ? Not sure what exactly are you trying to solve here.


  Multiple Machine

  1. if  single machine is powerful enough to support X number of test cases run simultaneously on 3 different browsers , then when to go for multiple machine approach ?
>>> You would normally resort to a multiple machine approach when you involve IE in the picture. IE AFAIK is only 1 browser per machine mode unlike the rest of the browsers  [ chrome and firefox]. That being said, I have seen FF start behaving weirdly when the number of FF concurrent tests hits above 15. So I normally keep the per machine FF instance count to 15.

Vikram

unread,
Oct 3, 2013, 9:19:08 AM10/3/13
to seleniu...@googlegroups.com
Hi Krishnan,

sorry for late reply.

Thanks a ton for detailed clarifications.

Regards,
Vikram

Harsh

unread,
May 23, 2014, 9:08:27 AM5/23/14
to seleniu...@googlegroups.com
Hello

On a bit old thread - can you experts please clarify if the 'concurrent IE on same m/c causing unpredictable behavior' - note is still valid?

Krishnan Mahadevan

unread,
May 26, 2014, 12:05:02 AM5/26/14
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


ASHUTOSH KUMAR

unread,
Jun 1, 2016, 4:26:01 AM6/1/16
to Selenium Users
Hello Krishnan,
                    I want to login on naukri.com using multiple user and search for large no of data by people's email id, address etc. I have data  loaded on phpmyadmin, and i want to take a fraction of this data for every user id and search on naukri.com. What should i do other than selenium grid??
Please reply ASAP..

⇜Krishnan Mahadevan⇝

unread,
Jun 1, 2016, 4:29:05 AM6/1/16
to Selenium Users
Ashutosh,
Your question is not clear enough. Can you please help add the below context as well ?

1. What have you done so far ? [ Please help share the code that you have so far ]
2. Where are you stuck ? [ Please help share any error details/stacktrace etc., ]

This will help the members of the forum get a better understanding about your problem and also help them in giving out suggestions to help you get past your problem.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Ramakrishna kolli

unread,
Jul 28, 2017, 8:13:18 AM7/28/17
to Selenium Users

Hi Krishnan,

I want to run multiple tests(about 50) in parallel using selenium and python on single machine with chrome or PhantomJS .
please point me the right script

Thank you in advance   

 

⇜Krishnan Mahadevan⇝

unread,
Jul 28, 2017, 8:14:52 AM7/28/17
to Selenium Users
What do you mean when you say "Point you the right script" ? I didn't quite get that. Can you please help elaborate on what you are looking for ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/44179a3a-06a8-412a-8f93-c0fc5b5fa6e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Linsong Wang

unread,
Jul 31, 2017, 8:06:21 PM7/31/17
to Selenium Users
I have developed a test automation framework, called reactor (see https://github.com/tascape/reactor)
It supports concurrent test execution. When applied to Selenium, we can run multiple browsers at the same time.
The extension for web UI automation is https://github.com/tascape/reactor-x-webui

It is written in Java, with full test report and log files.
If you want to try, please follow https://github.com/tascape/reactor-report/tree/master/doc to setup your test environment.

The demo code may not run correctly (not updated for a while). but you get the idea.
Let me know if you need further information.

Zunaira Maryam

unread,
Jun 22, 2020, 5:32:44 AM6/22/20
to Selenium Users
Hey Krishnan,
I have to run test cases parallel on a long polling website. Target is 1000 participants join at the same time and vote. But from single machine, only 30 participants are able to join. I'm using C# Nunit script. It seems like that script stuck after some position but I'm unable to find why the script sticks and how can we join at least 50 participants from one system
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

⇜Krishnan Mahadevan⇝

unread,
Jun 23, 2020, 9:12:24 AM6/23/20
to Selenium Users
The blog link you shared is only aimed at client side parallelism.
But there's a limit to the number of parallel instances that you can create on the client side. So you may have to start looking at distributing your load.

Maybe you can leverage a large scale selenium grid for this.

I dont think you can spin off more than 30 firefox instances on a single machine without firefox hogging on to your machine's resources and thus stalling things.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8e6fd1ba-727e-4ea9-b1e5-6308b1c91138o%40googlegroups.com.

Archana Singh

unread,
Jun 28, 2020, 3:57:33 AM6/28/20
to seleniu...@googlegroups.com
If you want 1000 virtual users it would be best to do it with jmeter. Take Jar of your code and place it in jmeter lib directory and run it. Also use headless browser , it is more efficient. Opening that many browser on one machine is not possible.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8e6fd1ba-727e-4ea9-b1e5-6308b1c91138o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages