HP UFT API Test - Saving Response/Checkpoint values

孤街浪徒 提交于 2019-12-08 07:53:11

问题


Is there a way to capture and store (or write to a file) the values returned in the Response? (Checkpoint values)

Using HP UFT 11.52

Thanks,

Lynn


回答1:


I figured it out. In UFT API under Standard Activities, there are File function modules including "Write to File". I added the module to the test, set the path and other properties, passed the variable to the file and it worked! Couldn't be easier.




回答2:


I mentioned this on my other answer , you can also write it programatically if you have dynamic array response please refer below: https://stackoverflow.com/a/28012383/3972994




回答3:


After running a test, in the test folder, you can find a Snapshots/LastIteration directory. In it you can find the return value for each step saved in a txt file. Pay attention that if you data drive the step, only the last iteration will be saved to file. However, in the Test's log (Test dir/Log/vtd_user.log) you can find all the iterations persisted

Thanks, Yossi




回答4:


You do not need to use the standard activities if you do this

var iResponse = this.Activity.responsebody;
System.IO.File.WriteLines(@"directorypath&FileName);

the above will write the response to the file and rewrite it for every run



来源:https://stackoverflow.com/questions/20916128/hp-uft-api-test-saving-response-checkpoint-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!