Unable to run multiple test cases in appium

Hello Guys,

I’m new to Appium automation testing. I’m gettingstuck to run multiple test cases in single project. Could you please someone help me out.

1)Created the project & created two class in that project.
2)Running individually each single class, that’s works fine. I would like to run multiple class in single project.So
3)Created the Testng.xml file.
which is below.

4)When i run this program, the first class works fine but the second class doesn’t call and gives the error. A new session could not be created. (Original error: Requested a new session but one was in progress)


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests" thread-count="20">
    <test name="Test">
            <class name="com.State.suite.Alolov" />
            <class name="com.State.suite.BNevigation" />

Could you please someone helping me out.

do you open diver in “beforeMethod” and do quit in “afterMethod” ?

Thanks …!!!It works now. I used driver.quit() method.