Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to perform multiple browser testing: While working on a project i needed to open multiple browsers simultaneously using Webdriver script.

Does anyone have experience in implementing this ?

share|improve this question
1  
in what language do you write your test scripts? –  Theo Jul 8 '13 at 12:59
add comment

2 Answers 2

Whether you want the ability to change the driver per execution of your tests, or simply rerun each test with multiple drivers, it's pretty straightforward. First you need to follow all of the instructions to get your drivers and browsers set up for the first execution. http://seleniumhq.org/docs/03_webdriver.jsp#selenium-webdriver-s-drivers.

In your code, it's also pretty straightforward, however you didn't mention a specific language or tool you're using to drive the automated tests... In C# some code may look like this:

        switch (browser)
        {
            case "Chrome":
                webDriver = new ChromeDriver();
                break;
            case "IE":
                webDriver = new InternetExplorerDriver();
                break;
            case "Firefox":
                FirefoxProfile profile = new FirefoxProfile();
                profile.AcceptUntrustedCertificates = true;
                webDriver = new FirefoxDriver(profile);
                break;
            default:
                Trace.WriteLine(String.Format("Browser '{0}' not recognized.  Spawning default Firefox browser.", browser));
                webDriver = new FirefoxDriver();
                break;
        }

If you wanted to execute everything in every browser (or at least every browser installed on a single machine), you could either create a foreach loop in your code, or if you're using something like nunit to execute the test cases, you could create parameterized tests that execute once for each parameter.

If you want additional info about how to execute on multiple versions of the same browser, or more detail about using a tool like nunit (or your specific tool) please clarify in your question.

share|improve this answer
add comment

I am not familiar with "Webdriver script", so I assume you are referring to a program that uses Selenium. You can write a program that opens multiple Drivers to talk to multiple simultaneous browsers. If you want that activity to happen in parallel, you will need to use multiple threads.

The specifics around how you open Drivers and use multiple threads depend upon the programming language.

share|improve this answer
    
+1 I just re-read the question and realized they most likely are asking how to open multiple browser windows simultaneously and not different browsers as my answer pointed to... Long holiday weekend :-) –  Sam Woods Dec 26 '12 at 23:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.