Forum Discussion

VasanthVijay's avatar
VasanthVijay
Contributor
10 years ago

how to get ipaddress using jscript in testcomplete?

Hi, http://support.smartbear.com/viewarticle/24733/ I tried with above link not working. I need to get ipaddress using jscirpt? Kindly help me in this case.
  • VasanthVijay's avatar
    10 years ago
    function GetSystemIpAddress()
    {
    var strQuery = "select * from Win32_NetworkAdapterConfiguration where IPEnabled=True"
    var objectsList = GetObject("winmgmts:").ExecQuery(strQuery)
    if (objectsList.Count > 0)
    {
    eObjectsList = new Enumerator(objectsList);
    for (; !eObjectsList.atEnd(); eObjectsList.moveNext())
    {
    item = eObjectsList.item();
    Log.Message(item.IPAddress(0));
    break;
    }
    }
    }

     

    This the jscript for getting the system ipaddress..Try this.