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.....



How enviornment veriable can be included into my script. I want to include some information into my..

Answer / 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

More WinRunner Interview Questions

For What are the browsers that WinRunner can Compatible? (I want Versions Like IE5.0 etc;)

3 Answers  


hi everyone today is the first time i saw this website,and hi iam siraj,iam very impressed by seeing evryones response towards questions,iam a newcomer and i have got tryining in testing can anyone please send me some projects relaited to testing.i know it is very confidential but still if u send it will a great help. my mail id mateen_012005@yahoo.com

3 Answers   Satyam,


What is the usage of Test case Design Techniques,in Integration/System Testing?

1 Answers  


What are the three modes of running the scripts?

1 Answers  


Explain the purpose of gui map configuration?

1 Answers  


can anybody tell me which type of questions raised on ERP domine in interviews?

0 Answers  


What is parameterizing?

1 Answers  


how to write the pass or fail message in winrunner for eg: in QTP we can write like "Reporter.reportEvenr,micDon,"Test Test pass"

2 Answers  


If we send the bug report but the developer didnt understood the bug report then will the tester do?

1 Answers  


what are the modules present in Winrunner?

2 Answers   Infosys,


1. How will you load the object during run time? 2. How do you close the Task Manager through QTP? 3. How will you handle the situation when object is not captured during record? 4. How QTP support all types of applications (Platforms) 5. What is throw object? 6. Purpose of automation as many points as possible 7. What In-string function will do? 8. In website, protocol has been changed http: to https what you will do? Tell me your Approach? 9. Runtime dynamic settings. 10. Types of exception handling and script for that. 11. On resume next(recovery, do u write the script in notepad, if so, what is the script and how to call it when ever it occurs? ________PLs anyone give me the answers for these questions. Thanks a lot!

1 Answers  


in which file Data of a Table is stored for further analysis

1 Answers  


Categories