Novice Learning Appium_python_client

Source: Internet
Author: User

Translated from http://blog.sina.com.cn/s/blog_68f262210102v538.html

One, the installation of appium_python_client

Recommended PIP Installation

Pip Install Appium-python-client

Of course, you can also download the source code installed on the PIPY

TAR-XVF appium-python-client-x.x.tar.gz (7zip can be decompressed on Windows)

CD appium-python-client-x.x

Python setup.py Install

Finally, it can also be installed via GitHub (to git client)

git clone [email protected]:appium/python-client.git

CD python-client

Python setup.py Install

Second, Appium_python_client introduction

Appium's practical methods are hidden in the client's source code, for driver and webelement instances, there is a corresponding element lookup method (Webelement look for the following sub-element), some children specifically for the function of the cell phone, You need to use this client after installation.

(The following is transferred from: http://testerhome.com/topics/1166)

Appium in order to implement its own Find method, the first custom of a Mobileby class, the class object is plugged into its definition of some of the extended properties, the values of these properties will be pushed to the server side by Webdriver protocol to identify and execute, In order for these attributes to be applied to the Find method, Appium well inherits and extends the Webdriver. Remote, and then implements the element lookup by invoking the driver instance's find_element and find_elements two core methods, so, since it is an extension, The Appiumdriver instance can use all of the Seleniumdriver's instance methods for element lookups, and their list can be sorted out.

Seleniumdriver

find_element_by_id
find_elements_by_id
Find_element_by_name
Find_elements_by_name
Find_element_by_link_text
Find_elements_by_link_text
Find_element_by_partial_link_text
Find_elements_by_partial_link_text
Find_element_by_tag_name
Find_elements_by_tag_name
Find_element_by_xpath
Find_elements_by_xpath
Find_element_by_class_name
Find_elements_by_class_name
Find_element_by_css_selector
Find_elements_by_css_selector

Appiumdriver

Find_element_by_ios_uiautomation
Find_elements_by_ios_uiautomation
Find_element_by_android_uiautomator
Find_elements_by_android_uiautomator
find_element_by_accessibility_id
find_elements_by_accessibility_id

Third, the use of appium_python_client

Once the installation is complete, you can use it for reference. We usually refer to Webdriver by using the following command:

From selenium import Webdriver

But we're going to use the functions in appium_python_client, and we're going to change to the following reference method:

From Appium import Webdriver

Then initialize the driver in the setup () function as follows:

Self.driver=webdriver. Remote (' Http://localhost:4723/wd/hub ', desired_caps)

You can call Appium's Special Method!!

Novice Learning Appium_python_client

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.