How to find local host name using QTP?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
WHAT IS THE SIZE OF OBJECT REPOSITORY USING IN YOUR COMPANY? Can any body tell me answer of this quation........
I am not able to record yahoomail browser.its giving error like "The browser Application can't be launched .Posssibly the URL is wrong" So anyone can tell me what setting i have to do in qtp??
Explain QTP using different development techniques ?
Use of Multiple Actions in QTP?
what is L-trim function will do?
I have a Webtable object in my shared object repository, say WT1, which has different index value in 2 different versions, one version having WT1's index value as 1 and other version having WT1's index value as 2. how could i use same test script to identify the WT1 object having different index values.
WHat is Object Identification and Object Spy?
datatable.Import("E:\Programming Samples\QTP Samples\OrderNumbers.xls") Asume we have 4 records in datatable Code reads the 4 rows in the sheet ok, but does it 5 times? It doesn't sound like closing the datasheet is the problem Can we close the datasheet runtime ?
How should I get results when I run scripts in a Batch mode
how to disable the pop ups through QTP using a script
How will you handle custom object in QTP?
when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks