zoukankan      html  css  js  c++  java
  • Appium -作业5(2)

    # coding:utf-8

    from appium import webdriver
    import time
    desired_caps = {
    'platformName':'Android',
    'deviceName':'test',
    'platformVersion':'4.4.4',
    'appPackage':'com.example.jcy.wvtest',
    'appActivity':'com.example.jcy.wvtest.MainActivity',
    'noReset':True,
    'unicodeKeyboard':True,
    'resetKeyboard':True
    }
    driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
    contexts = driver.contexts
    driver.switch_to.context(contexts[1])
    print driver.current_context
    time.sleep(2)
    ele = driver.find_element_by_id('index-kw')
    time.sleep(2)
    ele.send_keys(u'松勤')
    driver.find_element_by_class_name('newHisBtn').click()
    driver.find_element_by_id('index-bn').click()
    time.sleep(1)
    print driver.find_element_by_class_name('c-title-text').text
    driver.switch_to.context(contexts[0])
    driver.open_notifications()
    time.sleep(2)
    driver.press_keycode(3)
  • 相关阅读:
    Android List 排序
    Android Connection refused
    动态代理
    Java内存模型
    面试题整理
    检查结果
    单例模式
    2019年面试记录
    面试题目
    滑动窗口的最大值
  • 原文地址:https://www.cnblogs.com/hyzhang/p/10703294.html
Copyright © 2011-2022 走看看