javascript - UIAutomation script for setting textfield values in UItableView -
i’m new uiautomation , i’m trying enter value 2 textfields in uitabelview.
the script tried below
var target = uiatarget.localtarget(); var app = target.frontmostapp(); var window = app.mainwindow(); target.delay(1); var tableview = window.tableviews()[0]; tableview.logelementtree(); var cellone = tableview.cells()[0].textfields()[0].setvalue(“username”); var celltwo = tableview.cells()[1].textfields()[0].setvalue(“password”);
textfield in first cell gets entered second 1 fails. , when tried log element tree returns uielementnil
is there wrong script?
i went through apple's document on automation ui testing , followed recording manual user interface actions automation scripts , instruments created script me based on manual actions.
if struck mine , stupid me not go through apple's document. please don't , refer apple's document first.
here's reference
and here's script
var target = uiatarget.localtarget(); var app = target.frontmostapp(); var window = app.mainwindow(); window.buttons()["login"].tap(); target.delay(1); var tableview = window.tableviews()[0]; tableview.cells()[0].textfields()[0].textfields()[0].setvalue("username"); tableview.cells()[1].securetextfields()[0].securetextfields()[0].setvalue("password"); window.navigationbar().rightbutton().tap();
as can see failed notice password textfield securedtextfield.
Comments
Post a Comment