Appium 大家帮个忙看下,使用 appium+maven+TestNG 来做自动化测试结果输出,运行 TestNG Test 之后,没有启动被测试程序。

YYGiel · May 05, 2014 · Last by Anson replied at May 05, 2014 · 2333 hits

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

com.ex
zy
0.0.1-SNAPSHOT
jar

zy
http://maven.apache.org


UTF-8



junit
junit
3.8.1
test


org.testng
testng
6.8
test


org.seleniumhq.selenium
selenium-java
2.41.0


com.googlecode.json-simple
json-simple
1.1



pom文件是这样的,是不是还要在pom文件中插入啥,麻烦大家指点下。

共收到 5 条回复 时间 点赞

我用的,修改自官方的testng的pom,更新了appium 1.0的依赖,应该很多用不到的,里面有参数

<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>com.xx.qa</groupId>
<artifactId>xxxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>xxxx</name>
<url>http://maven.apache.org</url>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>LATEST</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>sauce_testng</artifactId>
<version>1.0.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.jyaml</groupId>
<artifactId>jyaml</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>1.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<systemProperties>
<property>
<name>var1</name>
<value>${var1}</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

</project>
YYGiel #2 · May 06, 2014 作者

#1楼 @532589730 我的pom改成这样了,还是不行,是不是还要添加其他的配置文件吗。

YYGiel #3 · May 06, 2014 作者

已解决。

#3楼 @zhouxiaoyagirl 什么问题?

YYGiel #5 · May 07, 2014 作者

还要添加一份testng.xml配置文件

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up