Getting the local network IP address using a Robot Functional Test
How do you create an IBM Rational Robot Functional script that obtains the local IP address?
Follow these steps to make a script that will identify the local IP address.
1) Create a batch file that calls the Windows IPCONFIG Utility.
Use a text editor like NotePad and create a file called ip.bat.
Include in the file the following line:
ipconfig > c:\ip.txt
Save this file to the root of the C: drive.
2) Then add the following code to your script:.
Dim Result As Integer
Dim l$, ip$
Result = Shell("C:\ip.bat")
Do Until Dir("C:\ip.txt")<>""
Open "C:\ip.txt" For Input As #1
Do Until EOF(1)
Line Input #1, l$
if InStr(l$,"IP Address") Then
This will save the IP Address in the variable called ip$.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
More support for:
Software version: 7.0.3, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206
Operating system(s): Windows
Reference #: 1171743
Modified date: 13 December 2012