1

I am looking to fetch the results folder from silk central so that I can place my qtp results in the same folder and thereby upload them to silk central. I know that the parameter #sctm_test_results_dir can be used in Java with System.getproperty and it works if my test is a Silk4J test. I have an executable jar file with steps to zip the results and place in the #sctm_test_results_dir directory and I call this JAR file from QTP. But the value returned for the results dir is null. It works fine if I try it as a keyword driven silk4j test though. Any help is appreciated.

The below code is the JAR file which I call from QTP using

Systemutil.Run "cmd",""/K "&str01,"" 

... where str01 is:

"cd c:\ "&chr(38)&chr(38)&chr(32)&"java -jar " &chr(34) & JarFilePath & chr(34) & chr(32) & SrcPath 

JAR file :

String Destpath=System.getenv("#sctm_test_results_dir"); 
// ^ returns null 
System.out.println("Sourcepath :"+Sourcepath); 
System.out.println("DestinationPath :"+Destpath); 
zip_pack(Sourcepath,Destpath+"\\test_z001.zip"); 
// ^ function to zip contents 
System.out.println("Zip complete");`

Thanks!

4

1 回答 1

0

使用类似的测试或执行参数SCResultDir并为其赋值${#sctm_test_results_dir}。这将在执行期间被实际结果目录替换。

QTP/UFT创建具有相同名称的测试输入参数(以开头的参数#在 UFT 中不起作用)。

现在要在某些操作中使用它,只需创建一个操作输入参数并将其分配给操作调用属性中的此测试参数。然后,您可以在此操作中将其用作您需要的任何参数。就这样做了,对我来说效果很好(在笔记本上显示)。

于 2018-06-05T13:48:19.147 回答