Appium_python3使用汇总

1. 对webview页面元素的处理

self.driver.switch_to.context("WEBVIEW_com.aaa.bbb")
source = self.driver.page_source
print("订单支付页面>>",source)
print("context>>",self.driver.context) # WEBVIEW_com.aaa.bbb
print("contexts>>", self.driver.contexts) #native_app webview_com.aaa.bbb
allure.attach(source,"订单支付页面webview内容")
print("001>>",self.driver.find_element(By.XPATH,".//*/ul/li/p[1]").text)
print("002>>", self.driver.find_element(By.XPATH, ".//*/ul/li[1]").text) # 订单信息,总保费1300元
print("003>>", self.driver.find_element(By.XPATH, ".//*/ul/li/p/span").text)

猜你喜欢

转载自www.cnblogs.com/jiguanghover/p/10735599.html