How to find local host name using QTP?

Answers were Sorted based on User's Feedback



How to find local host name using QTP?..

Answer / arunsingh

LHN=Environment.value("LocalHostName")
msgbox LHN

Run it, you will get you local host name.

Is This Answer Correct ?    13 Yes 1 No

How to find local host name using QTP?..

Answer / aiswaryan

Thanks Arun.
msgbox (environment("LocalHostName"))
this will also return the same. since these (LocalHostName,
OS etc) are built in environment variables, we can get the
values thro above syntax.

Is This Answer Correct ?    4 Yes 1 No

How to find local host name using QTP?..

Answer / aiswaryan

'Record the opening of command prompt in low level mode.
SystemUtil.Run "cmd","","C:\Documents and
Settings\<user>",""
wait 5
Record entering the text "hostname" in cmd prompt in Analog
mode .
Desktop.RunAnalog "Track2"
I have just started learning QTP. I am finding a proper
script to do the above task without recording in analog. If
anyone know please post the answers. Thx.

Is This Answer Correct ?    3 Yes 2 No

How to find local host name using QTP?..

Answer / sandeep

sorry this not the answer for this question . sorry.act I
want to post the ans for to open a notepad and write and
read contents of the notepad.once again sorry for
inconvience.

Thank You
Sailaja.

Is This Answer Correct ?    2 Yes 1 No

How to find local host name using QTP?..

Answer / ravi

if you like to hardcode its value, find here

control panel -> system -> general

Read the second line under Registered to:

Is This Answer Correct ?    0 Yes 5 No

How to find local host name using QTP?..

Answer / sailaja

The above code is giving error at for loop
Dim fso,notepad
set fso = createobject("scripting.filesystemobject")

file_path = "c:\nandu.txt"
'forwriting =2
'forreading = 1
set notepad = fso.createtextfile(file_path,1)
notepad.writeline "this is created by Nanda"
notepad.writeline"this is created on "

set notepad = fso.opentextfile(file_path,1)
Do
n = notepad.readline
msgbox n

Loop until ( notepad.atendofstream=true)

This will work fine.

Thank you
Sailaja

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More QTP Interview Questions

After coming to know that QTP could not identify non-standard objects, we set those non-standard objects as virtual objects using Virtual object wizard. But how can we identify that qtp could not identify non-standard objects?

6 Answers  


Which object repository we use in real time and can we merge 2 object repostiory and how?

3 Answers  


What are the key points to create a framework in QTP for oracle forms?

0 Answers  


if you run one test script in internetexplorer the same test you run in mozilla ffirefox is it possible or not how is it.

1 Answers   Satyam,


How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?

0 Answers  






When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

0 Answers  


Hi, My Application in Microsoft Dynamic Navision, is it compitibale with QTP? if yes then let me know...and also let me know is there any other automation tool availabe to automate Microsoft Dynamic Navision. Thanks Sandip. +91-9714177088

1 Answers  


What is .Ini file in QTP?

3 Answers  


In an(AUT) web application their are two frames as fraMain and fraFooter. Both the frames contain link which needs to be retrieved at a single step. I tried it using "Regular Expression" as fra.* but QTP doesn't recognize the object. So Plz help me out to get resolve the problem:-)

1 Answers  


what are the files created after executing QTP script file, please specify the file names with extensions

1 Answers   Virtusa,


Tell me Three major differences between QTP & Winrunner?

2 Answers  


What are the advantages of QTP over WinRunner?

5 Answers   CTS,


Categories