Can I retrieve the Computername from the System environment
When executing a test I also want to register on witch environment the test was run.
So I need the Computername of my machie.
Is there a possibility to retrevie this value in VB.
I already tried a default solutions as:
Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetComputerName() As String
Dim sResult As String * 255
GetComputerNameA sResult, 255
GetComputerName = Left$(sResult, InStr(sResult, Chr$(0)) - 1)
End Function
But I cannot Declare Functions in TestComplete.
Is there another way to retrieve this kind of System variables
Hi,
You can use HostName property, more about it: https://support.smartbear.com/viewarticle/68025/
Kristina
Sys.HostName contains the computer name.