SilkTest Question:

How can we get the IP address of a PC?

Tweet Share WhatsApp

Answer:

You can use the following
main
[ ] INTEGER iReturn
[ ] STRING sCmdLine = "ipconfig"
[ ] LIST OF STRING lsOutput
[ ] iReturn = SYS_Execute (sCmdLine , lsOutput)
[ ] listprint(lsOutput)

output is
[ ] Windows IP Configuration
[ ] Ethernet adapter Local Area Connection:
[ ] Connection-specific DNS Suffix . : abcd.xyz.net
[ ] IP Address. . . . . . . . . . . . : 1x.2xx.2xx.79
[ ] Subnet Mask . . . . . . . . . . . : 255.255.0.
[ ]Default Gateway . . . . . . . . . : 10.206.1.1

You need to do some trickery to parse and get the IP string..

Download SilkTest PDF Read All 146 SilkTest Questions
Previous QuestionNext Question
How to maintain global variable when script is run thru test plans?Problem with the VerifyBitmap