• python-appnium


    # coding:utf-8
    from appium import webdriver
    import time
    from selenium.webdriver.common.keys import Keys

    desired_caps = {'platformName': 'Android',
    'deviceName': '30d4e606',
    'platformVersion': '6.0',
    'appPackage': 'org.zywx.wbpalmstar.widgetone.Mobile.EBS.UAT',
    'appActivity': 'org.zywx.wbpalmstar.engine.LoadingActivity'}
    driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
    time.sleep(10)

    contexts = driver.contexts
    print contexts
    driver.switch_to.context(contexts[1])
    time.sleep(5)
    driver.find_element_by_id('userCode').clear()
    driver.find_element_by_id('userCode').send_keys('shenweihuang')
    time.sleep(1)
    driver.find_element_by_id('passWord').clear()
    driver.find_element_by_id('passWord').send_keys('888888a')
    time.sleep(1)
    driver.find_element_by_xpath(".//*[@id='page_0']/div[2]/div[3]/div").click()
    time.sleep(10)
    b = driver.current_window_handle
    time.sleep(1)
    driver.switch_to.window(b)
    time.sleep(3)
    driver.find_element_by_xpath(".//*[@id='MenuAll']").click()

    if __name__ == '__main__':
    pass
  • 相关阅读:
    哈希表,开放地址法之线性探测代码(JAVA)
    Java中几个关键字的意思
    java学习——File类操作
    Map三种遍历方法
    Spring Data Binding
    哈希表的基础理解
    选择排序
    map集合使用
    排序
    关于LinkedList
  • 原文地址:https://www.cnblogs.com/x666-6/p/9381048.html
Copyright © 2020-2023  润新知