惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

基础知识系列 on 打工人日志

Tmux 安装和使用教程 使用 ElasticSearch Curator 7天定期删除日志 GNU/Linux 一键更换系统软件源脚本 可观测性和监控的区别 基础知识-计算机系统 systemd 守护命令 Linux crontab 命令 linux常用命令 linux基础知识 yaml 语法 iptables 基础知识 网络基础知识 linux服务基础知识 mysql基础知识 shell基础知识 TCP/IP详解 运维知识图谱
在windows上安装appium
2023-05-15 · via 基础知识系列 on 打工人日志

在windows上安装appium

Appium 主要用于软件测试自动化领域,以帮助确定给定应用程序的功能是否按预期工作。与其他类型的软件测试相比,UI 自动化允许测试人员编写代码,在应用程序的实际 UI 中演练用户方案,尽可能模拟现实世界中发生的情况,同时实现自动化的各种好处,包括速度、规模和一致性。

安装nodejs

Appium是基于Node.js构建的,所以首先需要安装Node.js
下载地址:https://nodejs.org/en/download/
下载并安装,验证是否安装成功

安装appium

安装Appium。在命令提示符下运行:

安装appium-doctor

安装appium-doctor。在命令提示符下运行:

1npm install -g appium-doctor

安装appium-desktop

安装appium-desktop。在命令提示符下运行:

1npm install -g appium-desktop

安装jdk

下载地址:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html 下载并安装,验证是否安装成功

安装android-sdk

下载地址:https://developer.android.com/studio 下载并安装,验证是否安装成功

配置环境变量

在系统环境变量中添加以下变量

1ANDROID_HOME = D:\Android\sdk
2JAVA_HOME = C:\Program Files\Java\jdk1.8.0_311
3Path = %ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%JAVA_HOME%\bin

验证是否配置成功

启动appium

启动appium-desktop

测试脚本

创建测试脚本test.py

 1from appium import webdriver
 2import time
 3
 4desired_caps = {}
 5
 6desired_caps['platformName'] = 'Android'
 7desired_caps['platformVersion'] = '10'
 8desired_caps['deviceName'] = 'Android Emulator'
 9desired_caps['appPackage'] = 'com.android.calculator2'
10desired_caps['appActivity'] = '.Calculator'
11
12driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
13
14driver.find_element_by_id("com.android.calculator2:id/digit_2").click()
15driver.find_element_by_id("com.android.calculator2:id/op_add").click()
16driver.find_element_by_id("com.android.calculator2:id/digit_3").click()
17driver.find_element_by_id("com.android.calculator2:id/eq").click()
18
19time.sleep(5)
20
21driver.quit()

运行测试脚本