【发布时间】:2018-09-07 17:57:00
【问题描述】:
const { XCUITestDriver } = require('appium-xcuitest-driver');
const automationConfig = {
platformName: 'iOS',
platformVersion: '11.2',
deviceName: 'iPhone 7',
app: __dirname + '/cameo.app',
bundleId: 'com.app.myapp',
};
const driver = new XCUITestDriver();
driver.createSession(automationConfig)
.then(() => {
//WHAT DO I DO NOW??
})
上面的代码打开一个 iOS 模拟器,下载我的应用程序,然后打开它。如何找到一个元素并点击它?
如果我这样做 driver.findElement(By.xpath("//whatever-xpath")) 它告诉我 By 没有定义。但是By 不包含在driver 中。我查看了 appium 文档,但 API 指南仍然是 TODO >: |
我需要导入另一个模块来帮助解决这个问题吗?
在大量谷歌搜索之后,我也找不到任何有用的代码示例。
【问题讨论】:
标签: ios node.js react-native appium functional-testing