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

how to merge object repositories?

5 Answers  


What is Object Spy?

7 Answers   JKH, Ordain Solutions,


can we call a test in another test?

3 Answers   iFocus,


can any body give the banking domain concepts/links

0 Answers  


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

0 Answers   Livetek,






How does QTP identifes the object in the application?

1 Answers  


What is the difference between Image Checkpoint and Bitmap Checkpoint?

8 Answers  


what is a test strategy & what is the difference between test strategy & test plan?

5 Answers  


any body can you help me what is the script to automate an comand promt

0 Answers  


Can any suggest me what is exposure testing?

0 Answers   Value Labs,


How to make an Action as reusable?

1 Answers  


I have written a code to fetch values fro access db and place in the fields. Iam using GetROProperty to fetch runtime values. Now i want to add runtime values to the access db in field v3. please help me. Its not writting in the db. Option explicit Dim con,rs,db,c Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=D:\Sales.mdb" rs.open "select * from tax",con Do while not rs.eof Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("incost").Set rs.fields("v1") Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("intax").Set rs.fields("v2") c=Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("outtax").GetROProperty("value") rs.MoveNext print c Loop Do while not rs.EOF rs.EditMode rs.Fields("v3").Value="3" rs.Update rs.MoveNext Loop Set rs=nothing Set con=nothing

0 Answers  


Categories