httpclient+maven+excel+testng 框架实例----02 之项目目录结构及相关配置文件
参考博客:https://blog.csdn.net/u011541946/article/category/7680864
项目目录结构如下:
1)自定义配置文件:config.properties的内容如下:
Host = https://reqres.in
2)log4j.properties配置在默认的resources下面。如果配置到了别的目录下,会找不到这个文件。
log4j.properties的配置文件内容如下:
### set log levels ###
log4j.rootLogger = INFO, stdout, file
### 控制台输出###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss SSS} %-5p %c{1}:%L - %m%n
log4j.appender.file = org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File = ./log/apilog.log
# overwirte the old log file
log4j.appender.file.Append = true
##
log4j.appender.file.Threshold = INFO
log4j.appender.file.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss SSS} %-5p %c{1}:%L - %m%n
3)textng.xml文件内容如下:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1">
<parameter name="Name" value="jiangcui01"/>
<parameter name="Job" value="manager"/>
<test name="Test1">
<classes>
<class name="com.qa.tests.GetApiTest"/>
<class name="com.qa.tests.PostApiTest"/>
</classes>
</test>
</suite>
posted on 2018-06-05 16:54 chenzx0918 阅读(338) 评论(1) 编辑 收藏 举报