selenium - Appium iOS : How to find child element of an element -


appium : 1.3.1 mac os x 10.9.4

i face scenario need iterate loop through results , click on 1 of them if text matches.

as per hierarchy structure looks this

  >uiatableview      > uiatablecell             >uiastatictext      > uiatablecell             >uiastatictext      > uiatablecell             >uiastatictext      > uiatablecell             >uiastatictext 

click action works fine if take list uiatablecell.

i took list listingresults @iosfindby(classname="uiatablecell")

  (webelement resultnum : listingresults) {      resulttext= resultnum.gettext().trim();      if(!resulttext.contains("more option")){         system.out.println(resulttext);      }    } 

resultnum.gettext() not returning text. , text need "uiastatictext".

q. i'm trying use findelement , expecting resultnum.findelement(by.classname("uiastatictext")).gettext() return text. not working...

enter image description here

i got answer here

as per jlipps comment:

sometimes text indeed ''. did try getattribute('label'), getattribute('value'), , getattribute('name')?

and getattribute('name') worked in case


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -