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 automate a script in mainframes environment? I have the terminal emulator Add in. Describe in detail.

0 Answers  


QTP in mumbai

0 Answers  


Hi all, i have installed QTP8.2 in my system. but script is not generating while recording. What is the problem? is any file missing? pls let me know anybody...Thnaks

3 Answers  


Diff between WEB APPLICATION AND CLIENT-SERVER APPLICATION?

2 Answers  


How QTP recognizes Objects in AUT?

8 Answers   Blue Star,






Name the properties you would use for identifying a browser and page when using descriptive programming?

0 Answers  


Plz explain about MATCH/EXACT MATCH/IGNORE SPAGE in text check points?

1 Answers  


HI. Plz Clarifie my doubt,having 2+yrs experience in Testing , But My accedamics(Xth,INTER) are Less than 60%, But B.Tech 72%. It creats any problem , When i change to any MNC. plz tell me......... lot of friends told it's a problem, Some people says NO problem, What .............

3 Answers  


what is selective recording ? and normal recording?

1 Answers   iSoft,


In real time whenever we found bug , after that where you send to that bug. send to T.Lead or Directly Developer. Plz explain me?

2 Answers  


I AM TRYING PORT CODE FROM WINRUNNER TO QTP AND DON'T KNOW TO HOW TO CHECK THE ERRORS. IN WINRUNNER FUNCTION RETURNS EIGHER 0 OR -1 AGAINST WHICH RESULT CAN BE MADE PASS OR FAIL BUT IN QTP I DON'T SEE FUNCTIONS RETURNING ANY VALUE. APPRECIATE IF ANYONE COULD HELP ME CONVERTING FOLLWOING WINRUNNER CODE TO QTP. set_window("Customer Service"); rc = web_obj_get_text("Summary","#2","#4",ssn,""," ",1); if (rc != E_OK) { report_msg("[GetSubscriberSummary] Could Not get subscriber SSN; rc = "&rc); myRC = rc; } else { ssn = StripBlank(ssn); if (DEBUG) report_msg ("[GetSubscriberSummary] SSN: "&ssn); }

0 Answers  


where the object repository is located?how to choose the object repository as shared or action object repositories?

4 Answers   Datamatics,


Categories