Python appium operation of mobile phones and apps in various ways

Source: Internet
Author: User
Tags appium

Look at some online, together with the next, or some not enough, but are more commonly used, first put it out:

#锁定屏幕时间秒driver. Lock (5) #将APP放置后台 parameter Time Driver.background_app (5) #收起键盘driver. Hide_keyboard () #启动Activity Driver.start _activity (' Package name ', ' Activity name ') #打开通知栏driver. Open_notifications () #检查应用是否已经安装 parameter package name driver.is_app_installed (' xxxxxx ') # Install the application parameter path Driver.install_app (' path/my.apk ') #删除应用driver. Remove_app (' xxxxxx ') #摇晃 (Shake) Driver.shake () # Close the App Driver.close_app () #重置 (equals uninstall post reload) Driver.reset () #获取应用的字符串driver. app_strings# Key Event driver.keyevent (specific key) # Get current activitydriver.current_activity# Touch Action (touchaction)/multi-Touch Action (multitouchaction) action = touchaction (Driver) Action.press (Element=el, x=10, y=10). Release (). Perform () #滑动 (Swipe) parameter starts the x, y coordinates of the x, Y coordinate to slide to, duration msdriver.swipe (start=75 , starty=500, endx=75, endy=0, duration=800) #双指向内移动缩小屏幕driver. Pinch (element=el) zoom in Driver.zoom (ele) coordinates click DRIVER.TAP ([( x, y)],time) scroll driver.scroll (ele1,ele2) hold element and drag onto another element Driver.drag_and_drop (ele1,ele2) slide driver.swipe (x1 , Y1,x2,y2,time) Driver.flick (x1,y1,x2,y2) #滑动到某个元素. todo:xxxx# pull file pulls the file out of the device driver.pull_file (' Library/xxx/xxx.plisT ') #推送文件 (push file) to put the file in the device data = "test is good" path = "/data/local/tmp/test.txt" driver.push_file (Path, Data.encode (' Base64 ')) '

Python appium operation of mobile phones and apps

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.