adspace


How enviornment veriable can be included into my script.
I want to include some information into my Excel file using
Test run in WR. like User name of system?
waht is function to be used?
Please clarify.....

Answer Posted / Amit Kumar Sharma

You can include environment variables in your WinRunner script by utilizing the `SetEnv` command. This command sets or modifies an environment variable for the duration of your test run.nHere's how you can set a user name variable and use it to write data into an Excel file:
1. Set the user name environment variable at the beginning of your script:
`SetEnv username YourUserName`
2. In your test steps, use the GetEnvironmentVariable function to retrieve the user name and store it in a parameter:
`GetEnvironmentVariable username my_username`
3. Use the WriteExcel function to write this data into an Excel file:n```vbnetnWriteExcel 'C:pathtoyour_excel_file.xls' 1 1 my_usernamen```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Dear all i am new to testing my company using vb.net and we are developing web based application. How i can test those application with winrunner if any one have some good tutorial or link kindly provide thanks u.

2255


can i get apex technologies interview questions in testing

2437


Could you anyone share me the path to download the automation tools which are having trial license version?

2162