iphonedevkumar iphonedevkumar - 4 months ago 11
Swift Question

How to set a UItextfeild text in XCTest

I tried many but did not find a correct solution,

i want to set the text for my UITextFeild using xctest

app.textFields["enter "].tap()
app.textFields["enter "].text = "xyz"


but its throwing error and i am not finding any alternative way to do it.

can some one let me know how to do it

Answer

try

app.textFields["enter "].typeText("xyz")