• Android自动化测试脚本


    from appium import webdriver
    from time import sleep

    desired_caps={}
    desired_caps['platformName']='Android' #使用的移动平台iOS, Android, or FirefoxOS?
    desired_caps['platformVersion']='4.4.2' #平台版本号
    desired_caps['deviceName']='127.0.0.1:62001'
    desired_caps['appPackage']='com.youdao.calculator'
    desired_caps['appActivity']='com.youdao.calculator.activities.MainActivity'
    #输入中文需要设置下面这两个 参数:
    desired_caps['resetKeyboard']='True'
    desired_caps['unicodeKeyboard']='True'


    driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
    sleep(10)
    driver.find_element_by_id('com.ibox.calculators:id/digit8').click()
    driver.find_element_by_id('com.ibox.calculators:id/digit7').click()
    driver.find_element_by_id('com.ibox.calculators:id/plus').click()
    driver.find_element_by_id('com.ibox.calculators:id/digit3').click()
    driver.find_element_by_id('com.ibox.calculators:id/equal').click()
    sleep(3)
    driver.find_element_by_id('com.ibox.calculators:id/clear').click()

    driver.quit()
  • 相关阅读:
    1-6注册View Prism官网案例学习
    MVVM复习
    Prism常用类库翻译
    SqlHelper
    ADO.NET复习
    C#复习思维导图
    网络通信基础知识1
    网络通信
    Linux-线程同步之互斥锁
    linux-线程同步之信号量
  • 原文地址:https://www.cnblogs.com/zzzao/p/9235864.html
Copyright © 2020-2023  润新知