• 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
  • 相关阅读:
    配置并学习微信JS-SDK(1)
    在 Sublime Text 3 中运行 PHP
    apache-配置虚拟主机
    mysql-积累管理sql语句
    博客园-推荐发博客工具的安装配置
    注释多行文本
    nargin
    Sublime Text
    The MATLAB Profiler
    Fig723.asy
  • 原文地址:https://www.cnblogs.com/x666-6/p/9381048.html
Copyright © 2020-2023  润新知