Five: Appium elements 'relative positioning' targeting

The relative positioning of
the relative positioning of the elements is to find an element corresponding to the node have a parent attribute, then the positioning element based on the parent element.


Test cases
do not use the id element positioning mode, the new user interface registration click Add picture button.

Code implementation
by_relative.py

from find_element.capability import driver

driver.find_element_by_id('com.tal.kaoyan:id/login_register_text').click()

root_element = driver.find_element_by_id ( ' com.tal.kaoyan: ID / activity_register_parentlayout ' ) # entire page element 
root_element.find_element_by_class_name ( ' android.widget.ImageView ' ) .click () # entire page elements that little element

 

 

Guess you like

Origin www.cnblogs.com/zhenyu1/p/11942818.html