mercredi 20 septembre 2017

Click button with predicate + XCUITest

I am trying to click a button , which is having only Title and it will be changing according to number of products added to the cart.

Here is the properties

enter image description here

I used the following code to do this

let predicate = NSPredicate(format: "title BEGINSWITH[cd] 'Cart'")
    let button = XCUIApplication().buttons.element(matching: predicate)
    tap(on: button)

But it says element not found.

Any suggestions would be helpful.

And it would be great if you suggest any books for XCUITest.

Aucun commentaire:

Enregistrer un commentaire