Appium Common API One

Source: Internet
Author: User

Installation and uninstallation of 1.app

Driver.install_app (apk path): Install App

Driver.remove_app (App package name): Uninstall app

Driver.is_app_installed (App package name): Determine if the app is installed, returned true

2. Close and start the app

Driver.close_app ()

Driver.launch_app ()

3. Place the app in the background n seconds, and the page will automatically return to the foreground after n seconds.

Driver.background_app (N)

4. Get the current page and start the specified page

Driver.current_activity ()

Driver.start_activity (package name, activity name)

Can be used in such a scenario, if the current page is the login page to log in, otherwise open the login page before logging in:

If driver.current_activity () = = Login page:

//... Sign-in operation

Else

Driver.start_activity (package name, login page)

5. Wait for a page to appear

Driver.wait_activity ('. Customlocaleactivity ', 3, 1): Waits 3 seconds, checks every 1 seconds, and returns True when the page appears

6. Get the tree structure of the current page source code

Driver.page_source

7.

Driver.get_screenshot_as_file ("My. png")

Appium Common API One

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.