2017-02-28 39 views

回答

2

添加accessibilityIdentifier在您的應用程序的代碼,每個按鈕,並通過其標識符訪問你的測試每個按鈕告訴他們分開。輔助標識符不是面向用戶,即使是輔助功能的用戶,所以這不會影響您的用戶體驗。

// app code 
buttonA.accessibilityIdentifier = "buttonA" 
buttonB.accessibilityIdentifier = "buttonB" 

// test code 
let app = XCUIApplication() 
let buttonA = app.buttons["buttonA"] 
let buttonB = app.buttons["buttonB"] 
相關問題