objective c - iOS UI testing - presented view controller appearing as "other element" -


i trying write ui tests app. have pop modally presented view controller uitableview on it. tableview contains 2 clickable cells, both of dismiss view controller. problem when pop appears, appearing "other element" in elements tree , not view controller. can find element otherelements[@"popoverviewcontroller"] unable click cells on controller doesn't know are.

 →other 0x7fc778039540: traits: 8589934592, {{32.0, 155.5}, {311.0, 356.0}}, label: 'popoverviewcontroller' 

how can access element , click buttons on view controller?

thanks

edit

here output when popoverviewcontroller showing

  image 0x7fc26378c270: traits: 8589934596   image 0x7fc263784310: traits: 8589934596, {{0.0, 0.0}, {375.0, 64.0}}   button 0x7fc263786ff0: traits: 8724152321, {{8.0, 26.0}, {110.0, 30.0}}, label: '*****'   button 0x7fc26378d480: traits: 8724152321, {{8.0, 36.5}, {11.0, 11.0}}, label: '*****'   statictext 0x7fc263794620: traits: 8589934656   statictext 0x7fc2637817d0: traits: 8590000192   navigationbar 0x7fc263788140: traits: 35192962023424, {{0.0, 20.0}, {375.0, 44.0}}, identifier: '*****'   statictext 0x7fc263793090: traits: 8589934656, {{146.5, 70.5}, {82.0, 22.0}}, label: '*****'   button 0x7fc26378ea40: traits: 8589934593, {{67.5, 104.5}, {240.0, 35.0}}, label: '*****'   statictext 0x7fc26378de50: traits: 8589934656, {{86.0, 155.5}, {203.5, 38.5}}, label: '*****'   other 0x7fc263795f30: traits: 8589934592, {{67.5, 54.0}, {240.0, 168.0}}   other 0x7fc26379b470: traits: 8589934592   other 0x7fc26379a570: traits: 8589934592, {{0.0, 64.0}, {375.0, 148.0}}   other 0x7fc26378f9c0: traits: 8589934592, {{0.0, 216.0}, {375.0, 407.0}}   statictext 0x7fc26379be90: traits: 8589934656, {{90.0, 232.0}, {53.5, 20.5}}, label: '*****'   statictext 0x7fc26379c4f0: traits: 8589934656, {{90.0, 250.0}, {114.0, 19.5}}, label: '*****'   statictext 0x7fc26379cd60: traits: 8589934656, {{90.0, 289.0}, {57.0, 18.0}}, label: '*****'   cell 0x7fc2637934c0: traits: 8589934592, {{0.0, 216.0}, {375.0, 123.0}}   statictext 0x7fc26379dc10: traits: 8589934656, {{90.0, 355.0}, {52.5, 20.5}}, label: '*****'   statictext 0x7fc26379e330: traits: 8589934656, {{90.0, 373.0}, {98.0, 19.5}}, label: '*****'   statictext 0x7fc26379ea80: traits: 8589934656, {{90.0, 412.0}, {57.0, 18.0}}, label: '*****'   cell 0x7fc26379d490: traits: 8589934592, {{0.0, 339.0}, {375.0, 123.0}}   statictext 0x7fc26379f970: traits: 8589934656, {{90.0, 478.0}, {95.0, 20.5}}, label: '*****'   statictext 0x7fc2637a00b0: traits: 8589934656, {{90.0, 496.0}, {129.5, 19.5}}, label: '*****'   statictext 0x7fc2637a0800: traits: 8589934656, {{90.0, 535.0}, {57.0, 18.0}}, label: '*****'   cell 0x7fc26379f1f0: traits: 8589934592, {{0.0, 462.0}, {375.0, 123.0}}   table 0x7fc2637901b0: traits: 35192962023424, {{0.0, 64.0}, {375.0, 559.0}}   button 0x7fc2637a0ff0: traits: 8589934593, {{0.0, 623.0}, {375.0, 44.0}}, label: '*****'   other 0x7fc2637a1710: traits: 8589934592   other 0x7fc263796ea0: traits: 8589934592, {{0.0, 64.0}, {375.0, 603.0}}   other 0x7fc263799490: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc263791ac0: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc26376a060: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   image 0x7fc2637a26a0: traits: 4, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a2de0: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a3500: traits: 8589934592, {{32.0, 155.5}, {311.0, 356.0}}, label: 'popoverviewcontroller'   other 0x7fc2637a1f50: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc263782e40: {{0.0, 0.0}, {375.0, 667.0}}   window 0x7fc263112950: main window, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a4cc0: traits: 8589934592   other 0x7fc2637a44d0: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   window 0x7fc2637a3d50: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a6340: {{0.0, 0.0}, {375.0, 20.0}}   other 0x7fc2637a7210: traits: 8388608, {{6.0, 0.0}, {39.0, 20.0}}   other 0x7fc2637a7960: traits: 8388608, {{50.0, 0.0}, {13.0, 20.0}}, label: '3 of 3 wi-fi bars', value: ssid   other 0x7fc2637a80e0: traits: 8389120, {{165.0, 0.0}, {48.0, 20.0}}, label: '1:29 pm'   other 0x7fc2637a8850: traits: 8388608, {{345.0, 0.0}, {25.0, 20.0}}, label: '-100% battery power'   other 0x7fc2637a6a90: {{0.0, 0.0}, {375.0, 20.0}}   statusbar 0x7fc2637a5bd0: {{0.0, 0.0}, {375.0, 20.0}}   window 0x7fc2637a5450: {{0.0, 0.0}, {375.0, 667.0}} 

i can see popoverviewcontroller none of text or cells on (text blanked out presenting view controller, not what's on pop on view controller)

edit

if run [app.otherelements[@"popoverviewcontroller"] descendantsmatchingtype:xcuielementtypeany] see output:

other 0x7fc263795f30: traits: 8589934592, {{67.5, 54.0}, {240.0, 168.0}}   other 0x7fc26379b470: traits: 8589934592   other 0x7fc26379a570: traits: 8589934592, {{0.0, 64.0}, {375.0, 148.0}}   other 0x7fc26378f9c0: traits: 8589934592, {{0.0, 216.0}, {375.0, 407.0}}   other 0x7fc2637a1710: traits: 8589934592   other 0x7fc263796ea0: traits: 8589934592, {{0.0, 64.0}, {375.0, 603.0}}   other 0x7fc263799490: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc263791ac0: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc26376a060: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a2de0: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a3500: traits: 8589934592, {{32.0, 155.5}, {311.0, 356.0}}, label: 'popoverviewcontroller'   other 0x7fc2637a1f50: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc263782e40: {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a4cc0: traits: 8589934592   other 0x7fc2637a44d0: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}}   other 0x7fc2637a6340: {{0.0, 0.0}, {375.0, 20.0}}   other 0x7fc2637a7210: traits: 8388608, {{6.0, 0.0}, {39.0, 20.0}}   other 0x7fc2637a7960: traits: 8388608, {{50.0, 0.0}, {13.0, 20.0}}, label: '3 of 3 wi-fi bars', value: ssid   other 0x7fc2637a80e0: traits: 8389120, {{165.0, 0.0}, {48.0, 20.0}}, label: '1:29 pm'   other 0x7fc2637a8850: traits: 8388608, {{345.0, 0.0}, {25.0, 20.0}}, label: '-100% battery power'   other 0x7fc2637a6a90: {{0.0, 0.0}, {375.0, 20.0}} 

which possibly presented view controller can't see of objects due them being "other"

try accessing cell's content directly.

xcuiapplication *app = [[xcuiapplication alloc] init]; [app.statictexts[@"cell one"] tap]; 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -