question

Karuna avatar image
Karuna asked Spirent_Admin answered

Redirecting log to different file

Hi,

 

I am new to iTest and have started now to work on it.

 

Using a writeFile command , I am able to write only the value specified in the command($var) to a file(say test.txt)

 

Eg: writeFile  test.txt $var

 

If I have to redirect the logs of n number of commands and procedures too to file test.log , is there any option provided in writeFile command ?

 

Also "Topic not found" message is displayed  when i click on the online help of "WriteFile" command link.

 

Thanks.

iTest
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Spirent_Admin avatar image
Spirent_Admin answered
You can use the 'Append response to file" check box to save the response of any 'n' number of commands into the same file. Select the "Store Response" Propert in Step properties. Browse a file into the "File to write Response to" field for the steps you need to store the data and use the checkbox's available in this property page according to your requirement. ![alt text][1] [1]: /storage/temp/3431-3376-append.png

3376-append.png (68.2 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

PaulD avatar image
PaulD answered PaulD posted

You may find it useful to know about the [response <var_name>] command.  On a given step, you can configure a variable into which the response for that step will be written.  This response is internally a structure containing the textual response plus lots of other stuff, so be careful.  Suppose, for example, that on step 5 you set it so that it stores its response in variable "rsp".  Then on step 6 (or whenever), you can use a writeFile command that will write (or append) to test.txt using

 

writeFile  test.txt  [response rsp]

 

If the step of interest is a CLI step, then you have another option.   The telnet, ssh, and serial sessions have a feature that lets you do all of this by just setting up some step properties.  If you select the step(s) of interest, you'll see that there is a set of property pages (at the bottom of the editor page) under, for example, Telnet Command Properties, and under that there is a page of properties called Response.  In there, you can configure how this information will be written into a log file.

 

Note that you can also set up these properties in the session profile (or open step) and this will result in all of the responses from that session going into that log file.

 

I should note, of course, that all of this information already goes into the test report when you run the test case.  And you can ask iTest to generate other kinds of reports from that main report.  For example, you can generate a text version of the test report containing just the information you want in it.  To do this, you would need to create a custom report format using XSLT.  Or you could use one of the built-in report formats.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.