SilkTest Question 46: How to get machine hostname in SilkTest?

Could you create function with 4Test script which would return machine hostname?

There are at least two ways of getting desired value using 4test script. One of them using SYS_Execute function and one more is with SYS_GetEnv function. The both 4test code examples are posted below:

Silk Test

The SYS_Execute function uses Windows XP command prompt networking tool hostname which displays the host name portion of the full computer name. The SYS_GetEnv function returns the value of the COMPUTERNAME environment variable. The second method would work a little bit faster and definitely would be preferable for extensive regression testing.

No comments:

SilkTest interview questions for QA Testers