日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python/appium实现华为应用商城app界面上下滑动打开关闭通知栏等功能

發布時間:2024/1/8 python 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python/appium实现华为应用商城app界面上下滑动打开关闭通知栏等功能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
banner=driver.find_element_by_id('com.huawei.appmarket:id/banner_item_image') ele_size=banner.size #元素的高度和寬度 ele_height=ele_size['height'] ele_width=ele_size['width'] #獲取元素左上角坐標 loc=banner.location #計算起點的橫/縱坐標 #start_x1=loc['x']+ele_width*0.2 #start_y1=loc['y']+ele_height*0.5 #計算終點的橫/縱坐標 #end_x1=loc['x']+ele_width*0.8 #end_y1=start_x1 #滑動方法* #driver.swipe(start_x, start_y, end_x, end_y) #滑動方法*20(左右滑動) #通過相對定位屏幕坐標的方法,可以適配多種類型 #for i in range(20):#driver.swipe(start_x1,start_y1,end_x1,end_y1)#time.sleep(0.5)#上下滑動 start_x=ele_width*0.5 start_y=ele_height*0.8 end_x=start_x end_y=ele_height*0.2 for i in range(20):driver.swipe(start_x,start_y,end_x,end_y)time.sleep(0.5) #打開通知欄調用api driver.open_notifications() #關閉通知欄調用api time.sleep(2) #通過返回鍵關閉 driver.long_press_keycode(4)

總結

以上是生活随笔為你收集整理的python/appium实现华为应用商城app界面上下滑动打开关闭通知栏等功能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。