下载资源后端资源详情
appium练习.zip
大小:302.84KB
价格:15积分
下载量:0
评分:
5.0
上传者:weixin_61319245
更新日期:2024-08-28

移动端自动化测试-appium练习代码

资源文件列表(大概)

文件名
大小
appium练习/.git/
-
appium练习/.git/config
312B
appium练习/.git/description
73B
appium练习/.git/HEAD
23B
appium练习/.git/hooks/
-
appium练习/.git/hooks/applypatch-msg.sample
478B
appium练习/.git/hooks/commit-msg.sample
896B
appium练习/.git/hooks/fsmonitor-watchman.sample
4.62KB
appium练习/.git/hooks/post-update.sample
189B
appium练习/.git/hooks/pre-applypatch.sample
424B
appium练习/.git/hooks/pre-commit.sample
1.6KB
appium练习/.git/hooks/pre-merge-commit.sample
416B
appium练习/.git/hooks/prepare-commit-msg.sample
1.46KB
appium练习/.git/hooks/pre-push.sample
1.34KB
appium练习/.git/hooks/pre-rebase.sample
4.78KB
appium练习/.git/hooks/pre-receive.sample
544B
appium练习/.git/hooks/push-to-checkout.sample
2.72KB
appium练习/.git/hooks/sendemail-validate.sample
2.25KB
appium练习/.git/hooks/update.sample
3.56KB
appium练习/.git/index
2.88KB
appium练习/.git/info/
-
appium练习/.git/info/exclude
240B
appium练习/.git/logs/
-
appium练习/.git/logs/HEAD
192B
appium练习/.git/logs/refs/
-
appium练习/.git/logs/refs/heads/
-
appium练习/.git/logs/refs/heads/master
192B
appium练习/.git/logs/refs/remotes/
-
appium练习/.git/logs/refs/remotes/origin/
-
appium练习/.git/logs/refs/remotes/origin/HEAD
192B
appium练习/.git/objects/
-
appium练习/.git/objects/info/
-
appium练习/.git/objects/pack/
-
appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.idx
2.41KB
appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.pack
136.16KB
appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.rev
252B
appium练习/.git/packed-refs
114B
appium练习/.git/refs/
-
appium练习/.git/refs/heads/
-
appium练习/.git/refs/heads/master
41B
appium练习/.git/refs/remotes/
-
appium练习/.git/refs/remotes/origin/
-
appium练习/.git/refs/remotes/origin/HEAD
32B
appium练习/.git/refs/tags/
-
appium练习/.git/sourcetreeconfig.json
776B
appium练习/phone.png
145.45KB
appium练习/test_appium.py
932B
appium练习/test_appium_app.py
1KB
appium练习/test_appium_back.py
1.3KB
appium练习/test_appium_closeandquit.py
1.23KB
appium练习/test_appium_ControlsAPI.py
2.06KB
appium练习/test_appium_drag_and_drop.py
1.18KB
appium练习/test_appium_driver_get_view.py
1.13KB
appium练习/test_appium_findmore.py
1.36KB
appium练习/test_appium_findone.py
1.4KB
appium练习/test_appium_get_network.py
1.23KB
appium练习/test_appium_get_screenshot_as_file.py
1.18KB
appium练习/test_appium_getapp.py
1.12KB
appium练习/test_appium_install.py
1.3KB
appium练习/test_appium_long.py
1.31KB
appium练习/test_appium_move.py
1.31KB
appium练习/test_appium_open_notitfications.py
1.23KB
appium练习/test_appium_press_keycode.py
1.4KB
appium练习/test_appium_pressandreplese.py
1.5KB
appium练习/test_appium_scroll.py
1.18KB
appium练习/test_appium_swipe.py
1.32KB
appium练习/test_appium_tap.py
1.14KB
appium练习/test_appium_waitcansee.py
1.43KB
appium练习/test_appium_waitnosee.py
1.4KB

资源内容介绍

移动端自动化测试-appium练习代码
import unittestfrom time import sleepfrom appium import webdriverfrom selenium.webdriver.common.by import Bycapabilities = {}capabilities['platformName'] = 'Android'capabilities['automationName'] = 'uiautomator2'capabilities['deviceName'] = 'Android'capabilities['appPackage'] = 'com.android.browser'capabilities['appActivity'] = '.BrowserActivity'capabilities['language'] = 'en'capabilities['locale'] = 'US'appium_server_url = 'http://localhost:4723'class TestAppium(unittest.TestCase): def setUp(self) -> None: self.driver = webdriver.Remote(appium_server_url,capabilities) self.driver.implicitly_wait(30) def tearDown(self) -> None: if self.driver: sleep(2) self.driver.quit() def test_find_battery(self) -> None: # 点击 self.driver.find_element(By.XPATH,"//android.view.View[@resource-id='index-form']/android.view.View[1]/android.view.View").click() # 输入框内容 self.driver.find_element(By.XPATH,"//android.widget.EditText[@resource-id='index-kw']").send_keys("招聘") sleep(1) # 输入框清空内容 self.driver.find_element(By.XPATH,"//android.widget.EditText[@resource-id='index-kw']").clear() sleep(1) self.driver.find_element(By.XPATH,"//android.widget.EditText[@resource-id='index-kw']").send_keys("招聘") sleep(1) # 输出百度一下按钮的文本内容 print(self.driver.find_element(By.XPATH,"//android.widget.Button[@resource-id='index-bn']").text) sleep(1) # 获取百度一下按钮的位置和大小 print(self.driver.find_element(By.XPATH,"//android.widget.Button[@resource-id='index-bn']").location) print(self.driver.find_element(By.XPATH,"//android.widget.Button[@resource-id='index-bn']").size) # 获取百度一下按钮的属性值 print(self.driver.find_element(By.XPATH,"//android.widget.Button[@resource-id='index-bn']").get_attribute("text"))if __name__ == '__main__': unittest.main()

用户评论 (0)

发表评论

captcha