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.