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

is it possible to map an image as standard Object or u've to treat as virtual? how to map an Dynamic image into standard object?

1 Answers  


What are the features and benefits of Quick Test Pro(QTP)?

0 Answers   Crea,


Tell me about userdefined functions ?

1 Answers  


I am sathish , i want to test the Application of JIL.org ,Mobile Emulator ,by using QTP10.0. I am trying to do testing on that Application , but Child Objects are not identified by the QTP. Please can any one help me

1 Answers  


I Selected for TCS-Chennai(Contract to hire) position plz suggest me whether i have to join or not

2 Answers   TCS,






i have a window , initial its name is "NEW CUSTOMER" i have to enter the details of customer in the test object fields and after saving the window name is automatically changing with the customer name . so how to identify that window after saving. (i am using descriptive programming.)

5 Answers   Syntel,


What is active screen?

0 Answers  


Did u use check points during ur work experience ?

3 Answers   FedEx,


what is smart identification in qtp? pls any give details? thanks in advance

3 Answers   IBM,


what is the main process in QTP?

3 Answers   Ordain Solutions,


what is main diff of qtp8.2 and qtp9.0?

1 Answers   Covansys,


how can we compare descriptive programing with a regular expression

0 Answers  


Categories