【发布时间】:2019-10-02 22:11:10
【问题描述】:
尝试点击警报按钮时,一个非常小的 UI 测试失败,我错过了哪一步?
我正在尝试使用以下代码(我从recording my steps 获得)点击下面显示的警报中的“继续”按钮。
let app = XCUIApplication()
let salesforceloginbuttonButton = app.buttons["salesforceLoginButton"]
salesforceloginbuttonButton.tap()
let posWantsToUseSalesforceComToSignInAlert = app.alerts["“POS” Wants to Use “salesforce.com” to Sign In"]
let continueButton = posWantsToUseSalesforceComToSignInAlert.buttons["Continue"]
continueButton.tap()
当我运行测试时,它在最后一行(即:continueButton.tap())失败,错误为No matches found for Find: Descendants matching type Alert from input。
注意事项:
- 我已经尝试等待几秒钟,然后点击继续按钮,结果相同。
- 运行测试时,应用程序启动并在点击
salesforceloginbuttonButton后显示警报
【问题讨论】:
标签: ios swift salesforce xcode-ui-testing