0

I am new to TestNG. I'm using Hybrid Framework For Automation Testing, it's Hybrid Architecture based, in which Keyword(Java Methood name) and data is provided in Excel sheet, and based on that information each test case gets executed.

But I am not able to run the same test suite in multiple browsers at a time, so do you have any idea how I can integrate TestNG and do this.

What I want is if there is any way where I can specify:

  • run this many TC on Browser1 with user Role1,
  • and run 2nd suite on Browser2 With user Role2.

My .xml File is:

<?xml version="1.0" encoding="UTF-8"?> 
  <suite name="Suite" parallel="methods"> 
    <test name="Test"> 
      <parameter name="browserName" value="firefox"></parameter> 
      <parameter name="browserName1" value="chrome"></parameter> 
      <classes> 
        <class name="com.commonFunctions.ThreadLocalDemo" /> 
      </classes> 
    </test> <!-- Test --> 
  </suite>

My TestNG class is:

public class ThreadLocalDemo { 
  @org.testng.annotations.Parameters({"browserName"}) 
  @Test public void testMethod1(String browserName) 
    throws { DriverScript.Main(); } 
  @Test(dataProvider="browsername1") public void testMethod2(String browserName1) 
    throws { DriverScript.Main(); } 
}

The script code is at the link: https://drive.google.com/file/d/0B8YGjjoQPzG_NUY3Nk81SU5fNGs/view

  • Kindly share your web driver code and xml of test NG. – Helping Hands Mar 20 '15 at 8:18
  • My .xml File is as <?xml version="1.0" encoding="UTF-8"?> <suite name="Suite" parallel="methods"> <test name="Test"> <parameter name="browserName" value="firefox"></parameter> <parameter name="browserName1" value="chrome"></parameter> <classes> <class name="com.commonFunctions.ThreadLocalDemo" /> </classes> </test> <!-- Test --> </suite> – Rather Lenc Mar 20 '15 at 9:19
  • Shared @HelpingHands – Rather Lenc Mar 20 '15 at 9:41
  • it should be like parallel = "tests" - Did you try this? – Helping Hands Mar 20 '15 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.