剛剛咱們說到了,登入現在将一開始點選進去app時候廣告問題處理
下面話不多說代碼伺候
from base.base_page import BasePage
from appium.webdriver.common.mobileby import MobileBy
class HomePage(BasePage):
#初始化
def __init__(self,driver):
BasePage.__init__(self,driver)
#引導頁
self.yy_yindao=(MobileBy.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("me.onehome.app:id/immediately")')
# 廣告定位
self.ad_loc = (MobileBy.ANDROID_UIAUTOMATOR, 'new UiSelector().resourceId("me.onehome.app:id/closeButton")')
self.share = (MobileBy.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("me.onehome.app:id/action_bar_right_bt_iv")')
self.wx=(MobileBy.ID,'me.onehome.app:id/socialize_image_view')
#點選跳過引導頁
def click_yindaoye_ad(self):
self.click_element(self.yy_yindao)
#點選關閉廣告
def click_close_ad(self):
self.click_element(self.ad_loc)
#滑動頂部視圖
def scroll_top_view(self):
self.move_element_Action((664,132),(90,132),(717,1275))
#點選輪播圖 scroll_view
def click_scroll_view(self):
self.tap_position_touch_Action((361,137),(717,1275))
#點選分享:
def click_share(self):
self.click_element(self.share)
#點選微信:
def click_weixin(self):
self.click_elements(self.wx,0)
代碼已上傳,基本的app廣告處理完成, 頁面操作成功後,跳轉登入狀态,剛剛上傳的代碼,是咱們這個廣告進去的下一步操作,謝謝大家觀看,不足之處,還望博友多多提意見, 部落客虛心接受學習!