zoukankan      html  css  js  c++  java
  • Appium-We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"]

    APK 链接:https://pan.baidu.com/s/17oeTM1qA0QjPBqLh6pS0Yg 
    提取码:s9ru


    # coding:utf-8
    from appium import webdriver
    import time,traceback
    desired_caps = {}
    desired_caps['platformName'] = 'Android'
    desired_caps['platformVersion'] = '4.4.4'
    desired_caps['deviceName'] = 'test'
    desired_caps['app'] = r'c:/Appium/toutiao.apk'
    desired_caps['appPackage'] = 'io.manong.developerdaily'
    desired_caps['appActivity'] ='io.toutiao.android.ui.activity.LaunchActivity'
    desired_caps['unicodeKeyboard'] = True
    desired_caps['resetKeyboard'] = True
    desired_caps['noReset'] = True
    desired_caps['newCommandTimeout'] = 6000


    driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
    driver.implicitly_wait(15)
    try:
    driver.find_element_by_class_name("android.widget.ImageButton")
    time.sleep(5)
    xpath = '//*[@resource-id = "io.manong.developerdaily:id/tab_bar"]//android.widget.RelativeLayout[5]//android.widget.TextView'
    driver.find_element_by_xpath(xpath).click()


    # eles = driver.find_elements_by_xpath('//*[@resource_id="io.manong.developerdaily:id/tab_bar"]//android.widget.TextView')
    # for ele in eles:
    # print ele.text
    # eles[3].click() #python


    time.sleep(3)
    driver.find_element_by_id('io.manong.developerdaily:id/login_btn').click()
    time.sleep(2)
    driver.find_element_by_xpath('//*[@resource-id="io.manong.developerdaily:id/tab_layout"]//android.widget.RelativeLayout[2]//android.widget.TextView').click()
    ele = driver.find_element_by_id('io.manong.developerdaily:id/edt_phone')
    ele.set_value('13717617074')
    time.sleep(3)
    ele = driver.find_element_by_id('io.manong.developerdaily:id/edt_password')
    ele.set_value('mao112233')
    time.sleep(2)
    driver.find_element_by_id('io.manong.developerdaily:id/btn_login').click()
    except:
    print traceback.print_exc()
    input('****Press to quit..')
    driver.quit()











    send_keys () 参数不正确问题解决

    参考:https://www.cnblogs.com/crstyl/articles/7266341.html

  • 相关阅读:
    v$、v_$、gv$之间的关系
    10046确认多块读无法跨区
    查询表Or列的注释信息
    数据文件resize扩容
    11.2.0.4rac service_name参数修改
    数据库开启对sys用户的审计
    sql查询未走索引问题分析之查询数据量过大
    ORA-00600: internal error code, arguments: [kole_t2u], [34]
    ORA-00600: internal error code, arguments: [kcblasm_1], [103], [] bug
    Linux基础知识
  • 原文地址:https://www.cnblogs.com/hyzhang/p/10697223.html
Copyright © 2011-2022 走看看