Python 为什么我不能从APK中选择元素?
我想使用python从apk中选择一个元素。它总是返回null返回。这是我的密码Python 为什么我不能从APK中选择元素?,python,testcase,appium,Python,Testcase,Appium,我想使用python从apk中选择一个元素。它总是返回null返回。这是我的密码 import os from selenium import webdriver # Returns abs path relative to this file and not cwd PATH = lambda p: os.path.abspath( os.path.join(os.path.dirname(__file__), p) ) desired_caps = {} desired_caps
import os
from selenium import webdriver
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
desired_caps = {}
desired_caps['device'] = 'Android'
desired_caps['browserName'] = ''
desired_caps['version'] = '4.2'
desired_caps['app'] = PATH('/home/user/Desktop/abs.apk')
desired_caps['app-package'] = 'lk.xyz.abs'
desired_caps['app-activity'] = '.abs'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
textfields = driver.find_elements_by_tag_name("input")
textfields[1].send_keys("observer")
textfields[2].send_keys("test")
abspath(os.path.dirname(os.path.realpath(文件)))
os.path.abspath(os.path.dirname(os.path.realpath(__file__)))