python appium判断一个元素是否存在_appium自动化之元素属性是否存在的判断

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-29 02:05   11   0

import timefromappium import webdriverfromselenium.common.exceptions import NoSuchElementException'''mumu模拟器:抖音综合操作'''# 设备信息

desired_caps={"platformName": "Android","platformVersion": "6.0.1","deviceName": "127.0.0.1:7555","appPackage": "com.ss.android.ugc.aweme","appActivity": "com.ss.android.ugc.aweme.splash.SplashActivity","noReset": True,"unicodeKeyboard": True,"resetKeyboard": True

}

driver= webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

# driver.implicitly_wait(10)

time.sleep(6)

#判断元素是否存在

def is_element_exist(element,timeout=1):

count= 0

while count

souce=driver.page_sourceif element insouce:returnTrueelse:

count+= 1time.sleep(1)returnFalse

# 搜索操作

def douyin_s

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP