maven - Ant - How to direct where files are saved to -
in build.xml file, able search multiple folders .jmx files use in jmeter. want save output files, .jtl files in 1 folder in different location. being saved in same folder structure jmx files being read from.
so example have jmx files in root folder called jtesting, 2 folders inside called basket , customer. within each of these folders, there folder called jmxfiles contains .jmx files. path looks this:
jtesting/basket/jmxfiles & jtetsing/customer/jmxfiles
my ant file pulls these files out fine, when saving .jtl files, want store in results/jtl folder structure, instead saves as:
results/jtl/basket/jmxfiles & results/jtl/customer/jmxfiles
so adds folder structure got files. code below:
<?xml version="1.0" encoding="utf-8"?> <project default="all"> <!-- define environment variable pointing jmeter folder or change --> <property environment="env"/> <property name="jmeter.save.saveservice.output_format" value="xml"/> <property name="jmeter-home" location="${env.jmeter_dir}"/> <!-- ant-jmeter.jar comes jmeter, sure release have --> <path id="ant.jmeter.classpath"> <pathelement location="${jmeter-home}/extras/ant-jmeter-1.1.1.jar" /> </path> <taskdef name="jmeter" classname="org.programmerplanet.ant.taskdefs.jmeter.jmetertask" classpathref="ant.jmeter.classpath" /> <!-- todo: change deletes results folders , re-creates them --> <target name="clean"> <delete dir="results"/> <delete file="jmeter.log"/> <mkdir dir="results/jtl"/> </target> <target name="test" depends="clean"> <jmeter jmeterhome="${jmeter-home}" resultlogdir="results/jtl"> <testplans dir="jtesting" includes="/**/**/*.jmx"/> <property name="jmeter.save.saveservice.output_format" value="xml"/> <property name="jmeter.save.saveservice.assertion_results" value="all"/> <property name="jmeter.save.saveservice.bytes" value="true"/> <property name="file_format.testlog" value="${format}"/> <property name="jmeter.save.saveservice.response_data.on_error" value="${funcmode}"/> <property name="testdata.fullpath" value="c:/testdata"/> </jmeter> </target> <property name="lib.dir" value="${jmeter-home}/lib"/> <!-- use xalan copy jmeter lib directory ensure consistent processing java 1.4+ --> <path id="xslt.classpath"> <fileset dir="${lib.dir}" includes="xalan*.jar"/> <fileset dir="${lib.dir}" includes="serializer*.jar"/> </path> <!-- not needed plugin, produces nice html report can saved usin hudson's archive artifact feature --> <target name="report" depends="test"> <xslt classpathref="xslt.classpath" basedir="results/jtl" destdir="results/html" includes="*.jtl" style="${jmeter-home}/extras/jmeter-results-detail-report_21.xsl"/> </target> <target name="all" depends="test, report"/> </project>
how can .jtl files store in results/jtl???
use combination of following 2 tasks:
and if need create new file rather move existing file, use following task:
references
Comments
Post a Comment