无法在 Eclipse 中使用 Appium 启动 JUnit 测试



我想使用 Eclipse 和 appium 启动 JUnit 测试。当我右键单击并选择运行方式时,在项目中我选择我的项目,但在测试中不显示任何内容。任何想法我哪里出错了?

我的类构建如下:

public WebDriver driver = null;
@BeforeMethod
public void setUp() throws Exception {
  // set up appium
  DesiredCapabilities capabilities = new DesiredCapabilities();
  capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");
  capabilities.setCapability(CapabilityType.VERSION, "6.1");
  capabilities.setCapability(CapabilityType.PLATFORM, "Mac");
  capabilities.setCapability("app", "the path to the simulator app is correct, tested it with other software");
  driver = new RemoteWebDriver(new URL("http://127.0.0.1:4725/wd/hub"), capabilities);
}
@Test
public void test01() throws InterruptedException {
  Thread.sleep(5000);
}
@AfterMethod
public void tearDown() throws Exception {
  driver.quit();
}

确保以下库:

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

另外,尝试将@BeforeMethod和@AfterMethod更改为@BeforeTest/@AfterTest

最新更新