1

I have 2 classes in the same package which I need to run sequentially, ie, only after executing my 1st class should my 2nd class start executing. Right now, when I run my xml, 2 browsers are opening up at the same time. I tried giving parallel=false, but not working. Below is my code:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="BasicSuite" parallel="false">
  <test name="TPR Test">
    <classes>
      <class name="pulse.tpr.ClockinToClockout"/>
      <class name="pulse.tpr.RightNowToClockout"/>
    </classes>
  </test> 
</suite> 
Ramya Dipu
  • 61
  • 11

1 Answers1

0

I recommend you to use the following:

parallel="instances" thread-count="1"

And extra if you want to run in a specific order inside a class, you can use the following.

@Test
public void Test1() {

}

@Test (dependsOnMethods={"Test1"})
public void Test2() {

}

@Test (dependsOnMethods={"Test2"})
public void Test3() {

}

However this will work just inside your class. You can't assign a method from another class.

ib23
  • 95
  • 1
  • 7