3

I'm new at TestNG.

So, I want to know more details about how to run multiple test-cases on different browsers. Which Framework model should I use in my project? So that each & every part of my code is clear & understandable?

Right now I have about 30 Test Cases that I have to run on different browsers.

2 Answers 2

3

By using TestNG.xml we can easily run number of test cases on multiple browser. Is it right?

 <?xml version="1.0" encoding="UTF-8"?>
    <suite name="Suite" parallel="false">
      <test name="Test1">
      <parameter name="browserType" value="firefox"/>
        <classes>
          <class name="crossBrowserTesting.Magento_RAR_Framework"/>
        </classes>
      </test> <!-- Test -->
      <test name="Test2">
        <parameter name="browserType" value="chrome"/>
        <classes>
          <class name="crossBrowserTesting.Magento_RAR_Framework"/>
        </classes>
      </test> <!-- Test -->
      <test name="Test3">
        <parameter name="browserType" value="ie"/>
        <classes>
          <class name="crossBrowserTesting.Magento_RAR_Framework"/>
        </classes>
      </test> <!-- Test -->
    </suite> <!-- Suite -->
1

If you want to achieve parallel execution of test cases on different browsers, you can go for Selenium Grid.

It lets you run your tests on different machines having different browsers using a hub and node concept. If you don't have any other machine available, you can use your local system and register it as a hub and a node as well.

1
  • 1
    Is it possible to run same test cases on single machine with multiple browser? I think by using TestNG.xml file we can easily run it. Is it correct? Mar 29, 2016 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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