ios - Appium 不适用于 iOS

标签 ios appium

我是 Appium 的新手。正在关注THIS教程。我实际上有一个问题。当我运行我的 JAVA 代码时,“Bash 控制台”运行并且没有其他任何事情发生。

这是我的 Java 代码:

public void setUp() throws Exception {

// set up appium

File appDir = new File("/Users/ebryx/Library/Developer/Xcode/DerivedData/AppforTesingAutomation-fwqzlaiulhrxencjlttlxpjdhkwk/Build/Products/Debug-iphonesimulator");
File app = new File(appDir, "AppforTesingAutomation.app");

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");

capabilities.setCapability(CapabilityType.VERSION, "7.0");

capabilities.setCapability(CapabilityType.PLATFORM, "Mac");

capabilities.setCapability("app", app.getAbsolutePath());

driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub")

,capabilities);

System.out.println("App launched");

}



//@AfterMethod
public void tearDown() throws Exception {
driver.quit();
}



//@Test
public void testCases() throws InterruptedException {

//String myname = "Smriti";

driver.findElement(By.name("Change Color")).click();
//driver.findElement(By.xpath("//textfield[1]")).sendKeys(myname);
driver.findElement(By.name("Change Color")).click();

Thread.sleep(5000);

// write all your tests here

}

下面是图片。

enter image description here

最佳答案

当然什么也没有发生。 我相信您的程序现在不知道该做什么。

你需要测试引擎标记,那些你已经注释掉的... 您选择的教程非常好,我也是从那里开始的。不要忘记安装 TestNG。

@BeforeMethod
public void setUp() throws Exception {
  ...
}

@AfterMethod
public void tearDown() throws Exception {
  ...
}

@Test
public void testCases() throws InterruptedException {
  ...
}

关于ios - Appium 不适用于 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23559532/

相关文章:

android - 在 aws-device farm 中运行特定的 TestNG testng.xml 套件文件

ios - Appium1.13.0 似乎不支持 XCUITest Simulator 架构

java - Appium 没有点击一个元素

ios - 自定义表格 View 单元格中的 UITextField。点击单元格/文本字段时显示选取器 View

ios - 无法将 viewController 对象转换为 Swift 中的 viewController 类型

python - 无法解决 'No module named Appium' 错误

node.js - 在运行 appium 之前,我有一个警告作为 DeprecationWarning。它是什么?

objective-c - iOS:NSMutableArray 为空

ios - iPhone4/4S 对比其他媒体查询

iOS 应用程序在发布时崩溃但不调试