❶ 怎么使用appium连接android模拟器
1、Appium连接sdk中的模拟器
了解android的人都在知道,android sdk中自带AVD Manager(Android Virtual Device Manager).开发者会使用AVD Manager创建一个android模拟器来调试自己的应用。所以首先我们介绍如何让Appium连接好我们的模拟器
1) 创建一个AVD,并启动
点击Create 后填写相关信息后,点击OK,选中AVD后点击Start
2)启动appium 点击右上角的启动按钮
启动成功后,如下图
或者在cmd命令中输入:appium
2、Appium连接真机
实际开发的过程中我们可能是直接拿真机来调试。所以Appium如何连接真机呢?原理上和上述方式一致。但真机会稍微复杂一点
1)打开手机的USB调试模式
不同的手机打开调试模式的方式不同。一般都在设置中的开发者模式中打开
2)手机连接电脑
使用数据线连接手机与电脑,然后在cmd中输入adb devices查看是否连接成功
新手可能会出现两个问题
一是输入adb命令时提示不是内部命令或者外部命令
那么你需要下载一个adb工具包并存放在C:\Windows\System32目录下(必须强调:与sdk中的adb工具包版本一致!!!!)
二是需要打开手机的usb调试模式并安装好驱动
之后在cmd中输入adb devices 提示如下图则成功
3)启动appium服务
在cmd命令中输入:appium
启动成功
3、Appium连接第三方模拟器
有时候我们可能不太想用真机或者android sdk中自带的模拟器。而是使用一些三方的android模拟器。例如夜神,逍遥等等
理论上来说可以使用连接真机的方式一样来尝试连接。以下案例使用逍遥模拟器来做演示
1)使用adb连接到逍遥模拟器
网上网络了一番后,发现逍遥模拟器的连接方式是:adb connect 127.0.0.1:21503
所以其udid就是127.0.0.1:21503
2)连接到appium 服务
在cmd命令中输入:appium
启动成功
❷ adb install和pm install有什么不同的地方
以下用PM来代表pm install
区别很简单,adb install是将电脑中的apk文件直接安装到手机,它可以代替PM的三行代码,如果使用pm来安装电脑中的apk文件,那么命令就很复杂,命令为adb push *.apk/sdcard/
adb shell
pm install /sdcard/*.apk,所以说adb install也就是把上面三行代码一个命令完成,而PM install,是把手机中的APK文件安装到手机,不能把电脑中的APK文件安装到手机,不懂,请追问请采纳,谢谢
❸ appium java 用什么方法唤醒屏幕
一、appium学习方法:
1.下载sdk,学会一些基本命令,adb。。。其中包含手机驱动,链接相关的
2.搭建环境,网上有很多教程。
3.试着跑起来简单的case,学习脚本语言,js、python、ruby。。。appium支持很多种脚本语言,个人学习算是个入门,另外,appium也支持mac测试ios,在国内测试ios各方面较android匮乏情况下,是很不错选择,不用再依赖xcode。
二、java学习方法:
如果您是java的初学者,最想知道的莫过于如何才能学好java,以下是几点建议。
1.奠定java的语法基础 ,多看看Java入门基础视频教程、零基础 JAVA基础教程视频教程这类的课程。
学习java的第一步,就是学会使用java这个程序语言来编写程序,而学习程序语言的第一步就是熟悉其语法的使用。程序语言就是一门语言,所不同的是这种语言是用来与计算机沟通的,所以若要熟悉语言,使用的方法莫过于多看别人写的程序,了解别人是如何使用java来解决问题的,然后针对同样的程序进行练习,并从实例中测试自己是否真正了解到如何解决问题。
2.运用基本的j2seAPI
除了java语言本身的语法之外,懂得运用j2se的API也是一个必要的课题,然而在这么多的API下,您必然想知道哪些API是必要或常用的。我的建议是先掌握字符串处理、异常处理、容器(Container)、输入/输出(I/O)、线程(Thread)这几个主题。
API的内容庞大,没有任何一本是可以详细讲解每个API如何运用,您也不需要将API背诵下来,您要懂得查询API文件说明,虽然API文件都是英文的,但基本上只要有基本的英文阅读能力就足以应付查询需求。
❹ 如何使用appium的模拟机怎么用
1、Appium连接sdk中的模拟器
了解android的人都在知道,android sdk中自带AVD Manager(Android Virtual Device Manager).开发者会使用AVD Manager创建一个android模拟器来调试自己的应用。所以首先我们介绍如何让Appium连接好我们的模拟器
1) 创建一个AVD,并启动
点击Create 后填写相关信息后,点击OK,选中AVD后点击Start
2)启动appium 点击右上角的启动按钮
启动成功后,在cmd命令中输入:appium
2、Appium连接真机
实际开发的过程中我们可能是直接拿真机来调试。所以Appium如何连接真机呢?原理上和上述方式一致。但真机会稍微复杂一点
1)打开手机的USB调试模式
不同的手机打开调试模式的方式不同。一般都在设置中的开发者模式中打开
2)手机连接电脑
使用数据线连接手机与电脑,然后在cmd中输入adb devices查看是否连接成功
新手可能会出现两个问题
一是输入adb命令时提示不是内部命令或者外部命令
那么你需要下载一个adb工具包并存放在C:\Windows\System32目录下(必须强调:与sdk中的adb工具包版本一致!!!!)
二是需要打开手机的usb调试模式并安装好驱动
之后在cmd中输入adb devices
3)启动appium服务
在cmd命令中输入:appium
启动成功
3、Appium连接第三方模拟器
有时候我们可能不太想用真机或者android sdk中自带的模拟器。而是使用一些三方的android模拟器。例如夜神,逍遥等等
理论上来说可以使用连接真机的方式一样来尝试连接。以下案例使用逍遥模拟器来做演示
1)使用adb连接到逍遥模拟器
网上网络了一番后,发现逍遥模拟器的连接方式是:adb connect 127.0.0.1:21503
所以其udid就是127.0.0.1:21503
2)连接到appium 服务
在cmd命令中输入:appium
启动成功
❺ Appium超时错误连接到驱动程序时问题,怎么解决
问题
1. error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
之前的会话没有关闭,然后你又运行了测试实例,也没有设置覆盖.
解决:
1.重新停止appium服务,开启Appium服务
2.在Genarel Setting那里设置覆盖Session,重启Appium
测试结束在AfterClass加driver.quit()
2. error: Failed to start an Appium session, err was: Error: Command failed: C:Windowssystem32cmd.exe /s /c "D:android-sdk-windowsplatform-toolsadb.exe -s adb server version (32) doesn't match this client (36); killing…
wait-for-device"
error: could not installsmartsocketlistener: cannot bind to 127.0.0.1:5037:
没有链接上手机或者模拟器,请确认已经连接成功,重新链接
3. error: Android devices must be of API level 17 or higher. Please change your device to Selendroid or upgrade Android on your device.
手机系统低于4.2,appium不支持4.2.2以下的系统,请换一个手机或者模拟器来测试。
4. Error: Permission to start activity denied.
**activity在清单文件里面没添加Android:exported="true"的话,你不能直接打开对应的activity,需要从启动页activity打开。
exported属性就是设置是否允许activity被其它程序调用**
5. error: Failed to start an Appium session, err was: Error: Activity used to start app doesn't exist or cannot ve launched! Make usre it exists and is launchable activity
要打开的activity不存在,activity路径错误,改为完整正确的activity路径
6. error: Failed to start an Appium session, err was: Error: 'java - version' failed. Error: Command failed: C:Windowssystem32cmd.exe /s /c "java -version"
Java版本错误,请安装最新的版本。
7.> info: [debug] Error: Command failed: C:Windowssystem32cmd.exe /s /c "D:android-sdk-windowsplatform-toolsadb.exe -s 8806a0b0 shell "echo 'ready'"error: unknown host service
链接手机失败,重新链接手机即可,我就是重新拔插了一下usb
Error: Command failed: C:Windowssystem32cmd.exe /s /c "D:android-sdk-windowsplatform-toolsadb.exe -s 8806a0b0 shell "echo 'ping'""
error: unknown host service
adb被突然占用导致,例如你在运行用例的时候运行了模拟器。
8. UIAutomatorViewer提示: Unable to connect to adb. Check if adb is installed correctly
解决,sdk升级到了25产生的问题。
解决方法:
将adb.exe复制一份到uiautomatorviewer.bat目录下
修改uiautomatorviewer.bat文件最后一行(改binddir=%prog_dir%为自己的platform-tools本地路径)
9 error: Failed to start an Appium session, err was:INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling
When you are at final step to execute test automation script for mobile app testing on a mobile emulator or a virtual device or a real device, you might observe that script execution fails with different kinds of errors, In context to current article you will look at the error and solutions for: INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.
Error in Appium Server:
1
2
3
4
5
6
7
8
Error: Command failed: C:Windowssystem32cmd.exe /s /c
"C:Users{User}-toolsadb.exe -s
emulator-5554 install
"C:Program Files (x86)Appium ode_molesappiumuildsettings_apksettings_apk-debug.apk""
> Failed to install C:Program Files (x86)Appium ode_molesappiumuildsettings_apk
settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install
io.appium.settings without first uninstalling.]
Error in Android studio run console:
1
2
3
4
5
6
7
8
9
org.openqa.selenium.SessionNotCreatedException: A new session could not be created.
(Original error: Command failed: C:Windowssystem32cmd.exe /s /c
"C:Users{User}-toolsadb.exe -s emulator-5554 install
"C:Program Files (x86)Appium ode_molesappiumuildsettings_apksettings_apk-debug.apk""
Failed to install C:Program Files (x86)Appium ode_molesappiumuildsettings_apk
settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install
io.appium.settings without first uninstalling.]
) (WARNING: The server did not provide any stacktrace information)
Command ration or timeout: 0 milliseconds
For the first time when you execute the script itmight pass, but it will fail with above error when you try to execute the same or any other script multiple times. Or when your test script execution fails on the first attempt for some other reason, and when you fix it and execute it again, you might encounter this new issue.
原因:
The reason for this error is that Appium installs 2 mobile applications before executing the script.
1. io.appium.settings
2. io.appium.unlock
Theseare the supportive mobile applications appium utilizes to execute the test automation script in Mobile Emulator or virtual device or a real mobile device.
Ideally Appium should remove these files every time at the end of the script execution or termination, if it is intends to install themevery time a script is executed, or it should conditionally install these apps / apksto the mobile emulator or mobile device.
In your mobile emulator / Virtual Device / Real device, the 2 mobile applications appear as below:
There are multiple ways to troubleshootthis error and go ahead for asuccessful test script execution.
解决办法
Solution 1: ADB's uninstall command to remove the files.
You can open command prompt, assuming that you already had set the environment variables for ANDROID_HOME and Path variables for sdk tools and platform tools.
And execute commands as shown below:
Solution 2: Uninstall manually
You can open the mobile emulator / virtual device / real device and go to apps and uninstall them.
Solution 3: Write code as part of your test automation script.
As part of your selenium test automation script, you could write instructions to execute the commands provided in solution 1 above, so that this issue would not arise.
Hope this article has been helpful and you are able to proceed further with script execution.
Request to kindly share any of your queries in form of comments, we would try our best to provide any solution for you.
10.出错信息里含有"ps 'uiautomator',具体信息未 A new session could not be created. (Original error: Command failed: C:Windowssystem32cmd.exe /s /c "C:Userssxie-toolsadb.exe -s emulator-5554 shell "ps 'uiautomator'""
android-appium: A new session could not be created
junitexceptionandroidappium自动化
detail log:
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: C:Windowssystem32cmd.exe /s /c "C:Userssxie-toolsadb.exe -s emulator-5554 shell "ps 'uiautomator'""
) (WARNING: The server did not provide any stacktrace information)
Command ration or timeout: 0 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'WL00070299', ip: '10.110.12.39', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_40'
Driver info: driver.version: AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect..newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:161)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:76)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:73)
at com.sky.demo.ContactTest.setUp(ContactTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schele(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
==========================================
直接在cmd中执行"C:Windowssystem32cmd.exe /s /c "C:Userssxie-toolsadb.exe -s emulator-5554 shell "ps 'uiautomator'""
bad pid 'uiautomator'", 报错: bad pid 'uiautomator'
代码内容为
public class ContactTest {
private AndroidDriver driver;
@Before
public void setUp() throws Exception {
//设置apk的路径
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "apps");
File app = new File(appDir, "ContactManager.apk");
}
解决办法:
resolved by this way:
adb.js(C:Program Files (x86)Appium
ode_molesappium
ode_molesappium-adblibadb.js) 中1035 行this.shell("ps '" + name + "'", function (err, stdout) {
对应执行的指令是ps 'uiautomator', Android7不支持这个指令格式,所以执行结果是bad pid 'uiautomator'
目前Appium未对此进行处理,所以需要修改此指令的执行方式
即将
this.shell("ps '" + name + "'", function (err, stdout) {
if (err) return cb(err);
替换成
this.shell_grep("ps", name, function (err, stdout) {
if (err) {
logger.debug("No matching processes found");
return cb(null, []);
}
并增加上面用到的shell_grep函数:
ADB.prototype.shell_grep = function (cmd, grep, cb) {
if (cmd.indexOf('"') === -1) {
cmd = '"' + cmd + '"';
}
var execCmd = 'shell ' + cmd + '| grep ' + grep;
this.exec(execCmd, cb);
};
11.Android 7.0系统的手机无法执行appium脚本的问题
AppiumAppium 版本 1.4.16,Android 设备固件 7.x,执行脚本时,报错使用语言:python报错如下:
WebDriverException: Message: A new session could not be created. (Original error: Could not extract PIDs from ps output. PIDS: [], Procs: ["bad pid 'uiautomator'"])
这个是因为appium版本1.4.16使用的uiatumator1.0不支持的原因导致?如果不升级appium版本,是否有解决方案?
解决办法
uiautomator1.0应该是不支持7.0,不升版本就换用uiautomator2.0吧,或者用下面的改脚本的方法使用。
解决Android 7.0系统的手机无法执行appium脚本的问题,改问题的具体解决方法如下:
找到appium的安装目录下的adb.js文件,windows版本的目录如下:Appium
ode_molesappium
ode_molesappium-adblib
2、打开adb.js,手动修改该文件下的内容,此方法我已经试验成功。
adb.js 中1035 行this.shell("ps '" + name + "'", function (err, stdout) {
对应执行的指令是ps 'uiautomator', Android7不支持这个指令格式,所以执行结果是bad pid 'uiautomator'
目前Appium未对此进行处理,所以需要修改此指令的执行方式
即将
this.shell("ps '" + name + "'", function (err, stdout) {
if (err) return cb(err);
替换成
this.shell_grep("ps", name, function (err, stdout) {
if (err) {
logger.debug("No matching processes found");
return cb(null, []);
}
并增加上面用到的shell_grep函数:
ADB.prototype.shell_grep = function (cmd, grep, cb) {
if (cmd.indexOf('"') === -1) {
cmd = '"' + cmd + '"';
}
var execCmd = 'shell ' + cmd + '| grep ' + grep;
this.exec(execCmd, cb);
};
网上还有如下的修改解决办法:以下我未试验。
ADB.prototype.getPIDsByName = function (name, cb) {
logger.debug("Getting all processes with '" + name + "'");
this.shell("ps '" + name + "'", function (err, stdout) {
if (err) return cb(err);
stdout = stdout.trim();
var procs = [];
var outlines = stdout.split("
");
outlines.shift(); //在该处添加此行代码
3、重启appium
技巧
1.每次测试都重新安装app
为capabilities色设置noReset为true
capabilities.setCapability("noReset", true);
2.中文乱码
这都是编码问题:
1.方法1:
Android Studio修改文件编码的方法,最底部的UTf-8,点击选GBK就可以了,reload文件。(ps:先把文件内容全选复制一下再转换编码,再粘贴,不然文件内容就变乱码了)
2.方法2:
用的是原来的UTF-8编码,然后在测试mole的build.gradle里面添加三行代码
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
3.清除编辑框EditText内容
这个问题好像是看手机系统的,我之前的手机就会出现sendKeys的时候没有全选去掉本来的内容,现在都会自动全选覆盖了,这个也不算问题了。
/**
* 逐字删除编辑框中的文字
* @param element 文本框架控件
*/
public void clearText(AndroidElement element){
String className = element.getClass().getSimpleName();
if (className.equals("EditText")){
String text = element.getText();
//跳到最后
driver.pressKeyCode(KEYCODE_MOVE_END);
for (int i = 0; i < text.length(); i ++){
//循环后退删除
driver.pressKeyCode(BACKSPACE);
}
}else {
print("不是文本输入框架,无法删除文字");
}
}
1
4.点击输入法键盘的回车搜索
方法1:切换输入法
利用adb命令先切换为自己的输入法,按了搜索再切换为appium的输入法
查看当前手机的输入法
cmd执行下面的的代码
adb shell ime list -s
可以看到类似下面的结果,
C:UsersLITP>adb shell ime list -s
com..input_mi/.ImeService
com.sohu.inputmethod.sogou.xiaomi/.SogouIME
io.appium.android.ime/.UnicodeIME
C:UsersLITP>
执行adb命令
先写好一个执行cmd的方法
/**
* 执行adb命令
* @param s 要执行的命令
*/
private void excuteAdbShell(String s) {
Runtime runtime=Runtime.getRuntime();
try{
runtime.exec(s);
}catch(Exception e){
print("执行命令:"+s+"出错");
}
}
在需要搜索的时候执行下面的代码,切换的输入法用自己查看列表的输入法内容,我这里是搜狗输入法
//使用adb shell 切换输入法-更改为搜狗拼音,这个看你本来用的什么输入法
excuteAdbShell("adb shell ime set com.sohu.inputmethod.sogou.xiaomi/.SogouIME");
//再次点击输入框,调取键盘,软键盘被成功调出
clickView(page.getSearch());
//点击右下角的搜索,即ENTER键
pressKeyCode(AndroidKeyCode.ENTER);
//再次切回 输入法键盘为Appium unicodeKeyboard
excuteAdbShell("adb shell ime set io.appium.android.ime/.UnicodeIME");
❻ adb命令可以找到android设备,但是运行eclipse的时候appium时候找不到设备,怎么回
虚拟机设备,有时连接不上时,打开电脑端任务管理器,结束掉adb.exe进程,重启该虚拟机,一般就正常了,再不行装个刷机精灵,打开刷机精灵,显示连接中时就关掉刷机精灵,也能正常的使用adb设备了。
❼ appium如何解决每次都要安装apk的烦恼
两种解决方式
1、在cmd命令行执行:appium -a 127.0.0.1 -p 4723 -U (adb devices获取的设备号) --no-reset
其中,--no--reset是不进行安装apk
2、在初始化driver中,判断是否进行安装,如果已经安装,就执行权限或者设置
❽ Appium进行自动化测试的时候,始终无反应,也没有日志输出,请问什么原因
1. 启http服务器:127.0.0.1:4723 2. 根据测试代码setUp()进行初始化http服务器建立session象; 3. 始调用adb找连接设备设置设备id 猜测:我连接模拟器设备呢第二篇文章命令行启使用-U参数指定某设备我现图形界面启没指定设备 4. 等待设备准备响应命令 相关命令: c1: adb.exe -s emulator-5554 wait-for-device c2: adb.exe -s emulator-5554 shell "echo 'ready'" 5.启logcat志监控 java -jar appium\node_moles\appium\lib\devices\android\helpers\strings_from_apk.jar aimsi.apk c:\windows\temp\com.example.aimsi 条命令读取apk文件些apk基本信息json描述我例: { "app_name" : "Aimsi", "menu_settings" : "Settings", "title_activity_main" : "MainActivity", "RbtnImsi" : "汉字", "RtxtImsi" : "IMSI_IMEI" } apk属性信息文件strings.json存设备目录: c3:adb.exe -s emulator-5554 push "c:\\windows\\temp\\com.example.aimsi\\strings.json" /data/local/tmp 6.读取apk安装情况 c4:adb.exe -s emulator-5554 shell "pm list packages -3 com.example.aimsi" 读结我前已经安装apk 7.端口映射发给appium httpserver内容经httpserver直接发给设备 c5:adb.exe -s emulator-5554 forward tcp:4724 tcp:4724 8. 弄appiumjar包设备 c6:adb.exe -s emulator-5554 appium\node_moles\appium\build\android_bootstrap\appiumbootstrap.jar /data/local/tmp 网络bootstrap:Bootstrap 快速发Web应用程序前端工具包CSSHTML集合,使用新浏览器技术,给Web发提供尚版式 9.哇k安装unlock_apk-debug.apk c7:adb.exe -s emulator-5554 install appium\node_moles\appium\build\unlock_apk\unlock_apk-debug.apk apk用解锁屏幕解锁apk使其调试我猜者吧运行测试程序候看看手机没apk知道 10.kill掉所uiautomator进程 c8:adb.exe -s emulator-5554 shell "ps|grep 'uiautomator'" 我模拟器没启进程 11.执行bootstrap c9:adb.exe -s emulator-5554 uiautomator runtest appiumbootstrap.jar -c io.appium.android.bootstrap.bootstrap 帝原谅我没管写面紧跟着uiautomator输 12.bootstrap始工作 socket打4724端口appiumsocket服务器准备绪 加载json,唤醒客户端 等我想想设备apk--设备bootstrap--pcappium http server--测试程序先姑且猜着吧 13. 所设备运行窗口都输志文件判断设备已经解锁继续 c10:adb.exe -s emulator-5554 shell "mpsys window" 志文件写pc:appium\node_moles\appium\.mpsys.log 14.启测试程序 c11:adb.exe -s emulator-5554 shell "am start -S -n com.example.aimsi/.MainActivity" 15.等待测程序获焦点处超60s模拟器太慢居读两窗口才启功 16.创建session记初候根据setup提交给appium httpserver东东吧sessionid维持工作队列bootstrap队列面取命令执行像知道队列pc设备我觉像pc; 面些内容没啥看非步步调用 说啥研究些东西仔细做技术尤其测试技术原则用少搞明白底细遇问题候处理起快 吧
❾ 用appium做android移动App的自动化测试时,用python和java语言哪个更好
使用Python编写猫宁考勤应用注册模块的自动化测试
1,进入开发者模式.打开uiautomatorviewer工具
3.简单介绍unittest框架的使用方法
5;
cmd命令:adb devices .使用uiautomatorviewer工具获取应用的元素进行定位
4:
手机USB连接电脑.使用adb命令连接真机或模拟器.使用adb命令连接真机或模拟器
2开始第一个简单的Android UI自动化测试
❿ appium配置好了之后 adb 不是内部或外部命令 也不是可运行程序
没有配置好adb环境,重新在环境变量里添加好sdk tool目录,mac则是配置.bash_profile