首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

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

后端 302.84KB 18 需要积分: 1
立即下载

资源介绍:

移动端自动化测试-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()

资源文件列表:

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
0评论
提交 加载更多评论
其他资源 Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本
学习 Linux 的第一步:当然是从 Linux 命令 入手: 查看 Linux 命令帮助信息 - 关键词:help, whatis, info, which, whereis, man Linux 文件目录管理 - 关键词:cd, ls, pwd, mkdir, rmdir, tree, touch, ln, rename, stat, file, chmod, chown, locate, find, cp, mv, rm Linux 文件内容查看命令 - 关键词:cat, head, tail, more, less, sed, vi, grep Linux 文件压缩和解压 - 关键词:tar, gzip, zip, unzip Linux 用户管理 - 关键词:groupadd, groupdel, groupmod, useradd, userdel, passwd, su, sudo Linux 系统管理 - 关键词:reboot, exit, shutdown, date, mount, umount, ps, kill, systemctl, service
Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本 Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本 Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本
mybatis的普通使用
mybatis的普通使用,mybatis作用于mapper层和entity层,这里的mapper类似于servlet时的dao层
starfish.zip
starfish.zip
MobaXterm、WindTerm、xshell、finalshell、soureCRT快捷指令工具cxtool-4.0.0
MobaXterm、WindTerm、xshell、finalshell、soureCRT的快捷指令工具 详细说明见:https://blog.csdn.net/bandaoyu/article/details/139336859
request库练习代码
request库练习代码
ajax-promise-axios练习
此包可以帮助ajax,promise,axios这三个vue前置知识的学习
基于PythonFlaskWeb人工智能恶意文件检测系统 框架 html + css + jquery + python 3
基于PythonFlaskWeb人工智能恶意文件检测系统 框架 html + css + jquery + python 3.9 + flask + yara + 哈希散列 + mysql + orm + 人工智能检测 !!!!!!!注意事项!!!!!!!!!! yara不能有中文路径 留这几个个客户就行 病毒样本 https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Trojan:Win32/Silentbanker.B%E3%80%82 YYara download https://github.com/VirusTotal/yara/releases/tag/v4.5.0 用户类型 管理员 admin 123456 模块介绍 登录模型 系统首页 (上传抓包的文件并分析) PE信息解析 (上传PE文件并分析) 人工智能 恶意软件检测 子模块开始检测 子模块扫描结果 其他
滑板 滑板 滑板 滑板 滑板 滑板
滑板