找回密码
 立即注册

推荐阅读

  • 便民服务
  • 关注我们
  • 社区新手

8-6 appium做app自动化测试

[复制链接]
# coding=UTF-8

from appium import webdriver
from appium imprort sleep
desired_caps = {
   
'platformName' '的Android'
   
'DEVICENAME' '模拟器-5554'
   
'platformVersion' '7.0'
   
'appPackage' “融为一体。 baidu.netdisk'
   
'appActivity''com.baidu.netdisk.ui.Navigate'
   
'unicodeKeyboard'真正,
   
'resetKeyboard'True
}
driver = webdriver.Remote( http://127.0.0.1:4723/wd/hub,desired_caps)#xpath
= FrameLayout / LinearLayout / FrameLayout / RelativeLayout / LinearLayout [1] / Button [2]
driver.implicitly_wait(30
driver.find_element_by_id('loginBtn'。click()
driver.implicitly_wait(30
sleep(3)
driver.find_element_by_xpath(' // android.webkit.WebView/android.view.View/android.widget.EditText [1]')。send_keys(''
driver.find_element_by_xpath(' // android.webkit.WebView/ android .view.View / android.widget.EditText [2]')。send_keys(''
driver.find_element_by_xpath('
//android.webkit.WebView/android.view.View/android.widget.Button [1 ]')。click()driver.implicitly_wait(30
driver.find_element_by_xpath(' // memi.webkit.WebView/ android。 widget.ListView [1] /android.view.View [1]')。click()
sleep(10

driver.quit()
分享至 : QQ空间
收藏

0 个回复

您需要登录后才可以回帖 登录 | 立即注册