Then just add second driver variable in your tests. And use it for web.
E.g. i had projects with 3 drivers where 2 drivers are mobile phones that test between each other like chat and third is webdriver. Last one i used to check something in admin console or something other while api was closed for me.
No, this annotation property can be used only for methods within the same class. In your case, use dependsOnGroups instead. For example, given this class:
import org.testng.annotations.Test;
public class Test1 {
@Test(groups = { "test1" })
public void test1() {
assert true;
}
}
And this class:
import org.testng.annotations.Test;
public class Test2 {
@Test(groups = { "test2" }, dependsOnGroups = { "test1" })
public void test2() {
assert true;
}
}
Running the following testng.xml file will make test2() pass only if test1() is included in the suite as well. Otherwise, test2 will be ignored.