appium环境准备

安装appium

官方首页下载appium

安装adb

网上搜索

安装java环境

网上搜索

  • 注意事项:

    1. 想运行appium给的测试脚本需要导入依赖,新建maven项目,在根目录的xml文件导入依赖

      如下面所示:

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>org.example</groupId>
          <artifactId>appiumtest</artifactId>
          <version>1.0-SNAPSHOT</version>
      
          <properties>
              <maven.compiler.source>8</maven.compiler.source>
              <maven.compiler.target>8</maven.compiler.target>
          </properties>
          <dependencies>
              <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
              <dependency>
                  <groupId>io.appium</groupId>
                  <artifactId>java-client</artifactId>
                  <version>7.5.1</version>
              </dependency>
      
              <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
              <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
              <dependency>
                  <groupId>org.seleniumhq.selenium</groupId>
                  <artifactId>selenium-java</artifactId>
                  <version>3.141.59</version>
              </dependency>
      
              <!-- https://mvnrepository.com/artifact/org.junit/org.junit -->
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.13.2</version>
                  <scope>compile</scope>
              </dependency>
      
      
      
      
          </dependencies>
      
      
      
      
      </project>
      
    2. 导入的依赖需要对应版本,即java-client和selenium-java要对应上,否则报错。

安装genymotion

  • 下载带有虚拟机的版本,下载后删除重新官网下载6.0版本虚机
  • 虚拟机网络需要改为自动获取IP地址,具体设置百度搜索即可
  • 有些APP是不支持X86架构的,需要在虚拟机上加载ARM框架(https://www.jianshu.com/p/97b8250f359e)
posted @ 2021-06-10 17:23  77的小白  阅读(46)  评论(0)    收藏  举报