SilkTest Question:
Download Job Interview Questions and Answers PDF
How can we get the IP address of a PC?
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..
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 Interview Questions And Answers
PDF
Previous Question | Next Question |
How to maintain global variable when script is run thru test plans? | Problem with the VerifyBitmap |