# 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()
|
|