【APPUIAuto】6.企业微信打卡

app 入口获取

  • 通过logcat 获取
    adb logcat ActivityManager:I |findstr "cmp" 启动应用即可
  • 通过aapt获取
    appt dump badging wework.apk |findstr launchable-activity
  • 启动应用
    adb shell am start -W -n package-name/activityname -S
from appium import webdriver
# 获取 安装包和启动页名:adb logcat ActivityManager:I|findstr "cmp"

class TestWX:
    def setup(self):
        desire_cap = {
            "platformName": "Android",
            "deviceName": "882QADTN22V59",
            "appPackage": "com.tencent.wework",
            "appActivity": ".launch.LaunchSplashGovActivity",
            "settings[waitForIdleTimeout]":1,
            'noReset': True,
            'dontStopAppOnReset': True,  # 首次启动的时候不停止APP
            'skipDeviceInitialization': True  # 跳过安装、权限设置操作
        }
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desire_cap)
        self.driver.implicitly_wait(15)
    def teardown(self):
        self.driver.quit()

    def test_daka(self):
        self.driver.find_element_by_xpath("//*[@text='工作台']").click()
        self.driver.find_element_by_android_uiautomator(
            'new UiScrollable(new UiSelector().scrollable(true).instance(0)).'
            'scrollIntoView(new UiSelector().text("打卡").instance(0));').click()
        self.driver.find_element_by_xpath("//*[@text='外出打卡']").click()
        self.driver.find_element_by_xpath("//*[contains(@text, '次外出')]").click()
        self.driver.find_element_by_xpath("//*[@text='外出打卡成功']")

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容