Python+appium Get app Element property values

Source: Internet
Author: User
Tags appium
The attributes of an element are often used, and when positioned to an element, it is sometimes necessary to use the text value of the element, ClassName, Resource-id, checked, and so on.

The properties of the general standard can be obtained by get_attribute ("attribute name"), let's see how the following elements are obtained. From top to bottom.

Let's start with the text, we'll get to this element by XPath.

The Get text method is:

There are two methods, but generally the first one, because the writing is relatively simple. It would be nice to know that there is a second way.
Get Resource-id Value method:

Get ClassName Value Method:

Get Content-desc Value method:

In particular, when the value of the Content-desc is empty, this method gets the value of the element text and returns the corresponding value only if Content-desc is not empty.

Get the Check value method:

Element as long as the attribute value is Boolean, that is, false or true. Can be obtained by this method, it is not listed. Here the second method is often used, the focus of mastery!!

Get the element coordinates:

Basically, when you navigate to an element, the attributes in the element are available.

Python+appium Get app Element property values

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.