Java+Appium安装和入门测试

目录

一.环境搭建

1.jdk安装

2.安装Android SDK

3.appium安装

二.使用Appium

简单的代码入门

三种等待方式


一.环境搭建

1.jdk安装

首先在Oracle官网上下载jdk1.8.Java Downloads | Oracle,如下图所示 我下载下面画圈的,基本点下一步就可以了,在路径选择那里可以选择自己的路径

 

然后在系统环境中配置jdk路径

 然后在Path中添加下面

%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

然后在cmd中,输入Java -version会显示jdk版本就是成功了

2.安装Android SDK

下载链接AndroidDevTools - Android开发工具 Android SDK下载 Android Studio下载 Gradle下载 SDK Tools下载

 

 点开安装包(右键管理员模式打开)

 

 然后在安装目录双击打开SDK Manage.exe选择需要安装的api版本和对应的工具,这些在运行模拟器和真机测试的时候会使用到

 要点击以下地方

变成上面那样后就可以进行下载了

安装好之后

若是双击“SDK Manager.exe”一直闪退,打开tools/android.bat文件修改内容如下

打开SDK的tools/目录,然后编辑Android.bat内容


@echo off
rem Copyright (C) 2007 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem      http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem Useful links:
rem Command-line reference:
rem   http://technet.microsoft.com/en-us/library/bb490890.aspx

rem don't modify the caller's environment
setlocal enableextensions

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

rem Grab current directory before we change it
set work_dir=%cd%

rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0


rem Check we have a valid Java.exe in the path.

rem 原来的内容如下
rem set java_exe=
rem call lib\find_java.bat
rem if not defined java_exe goto :EOF

rem 修改为:
set java_exe=D:\Program Files\Java\jdk-1.8\bin\java.exe
rem D:\Program Files\Java\jdk-1.8\bin\java.exe  为java的路径

set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar

rem Set SWT.Jar path based on current architecture (x86 or x86_64)
for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a

:MkTempCopy
    rem Copy android.bat and its required libs to a temp dir.
    rem This avoids locking the tool dir in case the user is trying to update it.

    set tmp_dir=%TEMP%\temp-android-tool
    xcopy "%swt_path%" "%tmp_dir%\%swt_path%" /I /E /C /G /R /Y /Q > nul
    copy /B /D /Y lib\common.jar         "%tmp_dir%\lib\"          > nul
    copy /B /D /Y lib\commons-codec*     "%tmp_dir%\lib\"          > nul
    copy /B /D /Y lib\commons-compress*  "%tmp_dir%\lib\" &nb

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值