Ask a Question

how to get ipaddress using jscript in testcomplete?

SOLVED
VasanthVijay
Contributor

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.

Thanks and Regards,
Vasanth.V
Wittmann Battenfeld India Pvt. Ltd.,
Chennai.
Email : Vasanth.Veeravijayan@wittmann-group.com
Website : www.wittmann-group.com
Mobile: +91 8870219392 | Landline: +91 44 4207700
2 REPLIES 2
VasanthVijay
Contributor

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.

Thanks and Regards,
Vasanth.V
Wittmann Battenfeld India Pvt. Ltd.,
Chennai.
Email : Vasanth.Veeravijayan@wittmann-group.com
Website : www.wittmann-group.com
Mobile: +91 8870219392 | Landline: +91 44 4207700
Prodigio
Occasional Contributor

I've tried the solution above, but couldn't get it working.

 

I'm getting the "JavaScript runtime error" with "Invalid number of parameters".

 

Unfortunately I'm totally new to JavaScript, so I don't know how to fix that.

 

I also found other ways of how one could get the IP Address of the machine, where TestComplete is running on, but they felt way more difficult than this one.

 

I'd appreciate any help on this!

cancel
Showing results for 
Search instead for 
Did you mean: