JMeter下载文件及判断文件是否存在

2 判断文件是否存在,添加一个BeanShell Assertion

import java.io.File; 
import java.io.FileNotFoundException; 
import java.io.FileWriter; 
import java.io.IOException; 
import java.io.RandomAccessFile; 

     StringBuffer fileBuf=new StringBuffer(); 
            String filePar = "D:\\localsimicastool\\V0.2.3\\SimicasTool\\V0.2.3\\repo\\centralserver\\V0.0.9";
            File myPath = new File( filePar ); 
            if(!myPath.exists())
              {
                  Failure=true;
                  FailureMessage = "error, check";
               }
               else
              {
                  FailureMessage = "ok!";
                      }
            表示:目录成功就是ok,断言失败就error, check

JMeter下载文件及判断文件是否存在

 

参考文档:

https://www.cnblogs.com/weijiangbao/p/7862278.html

https://www.cnblogs.com/chenhuina/p/9023919.html

https://www.cnblogs.com/111testing/p/10301442.html

https://www.jianshu.com/p/2341b901cd4a

相关文章: