????1.???????Junit??????????£?
???????????
????public class AppiumTest extends TestCase
????2.Appium??????????????????????app??????á???????????/?????????????????????setUp()????
???????????
????public void setUp() throws MalformedURLException{
????//??????
????DesiredCapabilities capabilities= new DesiredCapabilities();
????capabilities.setCapability( "device"?? "Anroid");
????capabilities.setCapability( "deviceName"?? "Android");
????capabilities.setCapability(CapabilityType. BROWSER_NAME?? "");
????capabilities.setCapability( "platformName"?? "Android");
????capabilities.setCapability( "platformVersion" ?? "4.4" );
????File classpathRoot= new File(System. getProperty( "user.dir"));
????//????apk ???·??
????File appDir= new File(classpathRoot?? "apps");
????File app= new File(appDir?? "Test.apk" );
????capabilities.setCapability( "app"?? app.getAbsolutePath());
????//????apk ????
????capabilities.setCapability( "app-package"?? "android.test" );
????//????apk ?????
????capabilities.setCapability( "app-activity"?? ".TestActivity");
????//AppiumDriver
????driver= new AppiumDriver( new URL("http://127.0.0.1:4723/wd/hub" )??capabilities);         
????}
????3.Appium??????????????????????????tearDown()????
???????????
????public void tearDown(){      
????driver.quit();         
????}
????4.??????????д???????testXX???
???????????
????public void testClick(){
????//findElementByName??????????????????
????WebElement el= driver.findElementByName( "buttonText");
????el.click();
????}
????????????????????????????????api???????????