首页下载资源后端移动端自动化测试-appium练习代码

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

weixin_61319245302.84KB需要积分:1

资源文件列表:

appium练习.zip 大约有69个文件
  1. appium练习/.git/
  2. appium练习/.git/config 312B
  3. appium练习/.git/description 73B
  4. appium练习/.git/HEAD 23B
  5. appium练习/.git/hooks/
  6. appium练习/.git/hooks/applypatch-msg.sample 478B
  7. appium练习/.git/hooks/commit-msg.sample 896B
  8. appium练习/.git/hooks/fsmonitor-watchman.sample 4.62KB
  9. appium练习/.git/hooks/post-update.sample 189B
  10. appium练习/.git/hooks/pre-applypatch.sample 424B
  11. appium练习/.git/hooks/pre-commit.sample 1.6KB
  12. appium练习/.git/hooks/pre-merge-commit.sample 416B
  13. appium练习/.git/hooks/prepare-commit-msg.sample 1.46KB
  14. appium练习/.git/hooks/pre-push.sample 1.34KB
  15. appium练习/.git/hooks/pre-rebase.sample 4.78KB
  16. appium练习/.git/hooks/pre-receive.sample 544B
  17. appium练习/.git/hooks/push-to-checkout.sample 2.72KB
  18. appium练习/.git/hooks/sendemail-validate.sample 2.25KB
  19. appium练习/.git/hooks/update.sample 3.56KB
  20. appium练习/.git/index 2.88KB
  21. appium练习/.git/info/
  22. appium练习/.git/info/exclude 240B
  23. appium练习/.git/logs/
  24. appium练习/.git/logs/HEAD 192B
  25. appium练习/.git/logs/refs/
  26. appium练习/.git/logs/refs/heads/
  27. appium练习/.git/logs/refs/heads/master 192B
  28. appium练习/.git/logs/refs/remotes/
  29. appium练习/.git/logs/refs/remotes/origin/
  30. appium练习/.git/logs/refs/remotes/origin/HEAD 192B
  31. appium练习/.git/objects/
  32. appium练习/.git/objects/info/
  33. appium练习/.git/objects/pack/
  34. appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.idx 2.41KB
  35. appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.pack 136.16KB
  36. appium练习/.git/objects/pack/pack-cdde6e7ec26c2e6464a8acec31205ec9d61f4268.rev 252B
  37. appium练习/.git/packed-refs 114B
  38. appium练习/.git/refs/
  39. appium练习/.git/refs/heads/
  40. appium练习/.git/refs/heads/master 41B
  41. appium练习/.git/refs/remotes/
  42. appium练习/.git/refs/remotes/origin/
  43. appium练习/.git/refs/remotes/origin/HEAD 32B
  44. appium练习/.git/refs/tags/
  45. appium练习/.git/sourcetreeconfig.json 776B
  46. appium练习/phone.png 145.45KB
  47. appium练习/test_appium.py 932B
  48. appium练习/test_appium_app.py 1KB
  49. appium练习/test_appium_back.py 1.3KB
  50. appium练习/test_appium_closeandquit.py 1.23KB
  51. appium练习/test_appium_ControlsAPI.py 2.06KB
  52. appium练习/test_appium_drag_and_drop.py 1.18KB
  53. appium练习/test_appium_driver_get_view.py 1.13KB
  54. appium练习/test_appium_findmore.py 1.36KB
  55. appium练习/test_appium_findone.py 1.4KB
  56. appium练习/test_appium_get_network.py 1.23KB
  57. appium练习/test_appium_get_screenshot_as_file.py 1.18KB
  58. appium练习/test_appium_getapp.py 1.12KB
  59. appium练习/test_appium_install.py 1.3KB
  60. appium练习/test_appium_long.py 1.31KB
  61. appium练习/test_appium_move.py 1.31KB
  62. appium练习/test_appium_open_notitfications.py 1.23KB
  63. appium练习/test_appium_press_keycode.py 1.4KB
  64. appium练习/test_appium_pressandreplese.py 1.5KB
  65. appium练习/test_appium_scroll.py 1.18KB
  66. appium练习/test_appium_swipe.py 1.32KB
  67. appium练习/test_appium_tap.py 1.14KB
  68. appium练习/test_appium_waitcansee.py 1.43KB
  69. appium练习/test_appium_waitnosee.py 1.4KB

资源介绍:

移动端自动化测试-appium练习代码
import unittest from time import sleep from appium import webdriver from selenium.webdriver.common.by import By capabilities = {} 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()
100+评论
captcha