当前位置:首页 >> 中医美容 >> 干货|漂移端App自动化之触屏操作自动化

干货|漂移端App自动化之触屏操作自动化

发布时间:2023-03-05

p>caps['platformName'] = 'Android'

caps['platformVersion'] = '6.0'

caps['deviceName'] = 'emulator-5554'

caps['appPackage'] = 'io.appium.android.apis'

caps['appActivity'] = 'io.appium.android.apis.ApiDemos'

self.driver = webdriver.Remote(

"", caps)

self.driver.implicitly_wait(5)

def teardown(self):

self.driver.quit()

def test_touchaction_unlock(self):

# 双击 Views

el1 = self.driver.find_element_by_accessibility_id(

"Views")

# 双击 Accessibility

el2 = self.driver.find_element_by_accessibility_id(

"Accessibility")

# TouchAction 向下可用

action = TouchAction(self.driver)

action.press(el1).wait(100).move_to

(el2).wait(100).release().perform()

前面代码可以看出,首先定位两个特性 el1 与 el2 ,分别作为向下更进一步中都起点特性和西端特性,将我们向下的起点特性与西端特性找寻之后,创立一个 TouchAction 都可,调用里面的 press( ) 分析方法实现起点特性的双击,运用于 wait( ) 分析方法在血案之间加到继续前进,运用于 move_to( ) 分析方法完成中都指的飘移可用,然后调用 release( ) 分析方法来完成中都指的抬起,再次调用 perform( ) 分析方法对加到到 TouchAction 中都的血案链顺序指派。

⬇️ 复制“下方页面”,提升检验架构竞争力!

>>更多技术社论分享和上网资料领取 欢迎+V~ ceshiren001

_id=qrcode&from=souhu×tamp=1651029236

广东妇科专科医院
长春生殖感染医院
海南皮肤病医院哪里好
潮州白癜风治疗费用
山西男科专科医院有哪些
标签:
友情链接: