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 |
How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?
What is the basic concept of qtp?
In qtp, how you can exit for loop?
How do I generate Test Results window using descriptive method ( run time ) after my test execution process? Please have a look of my below code. ========================================================= Dim qtApp Dim qtTest Dim qtResultsOpt Set qtApp = CreateObject("QuickTest.Application") qtApp.Launch qtApp.Visible = True qtApp.Options.Run.CaptureForTestResults = "Always" qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = True qtApp.Open "C:\Automation\Example", True Set qtTest = qtApp.Test qtTest.Settings.Run.OnError = "NextStep" Set qtResultsOpt = CreateObject ("QuickTest.RunResultsOptions") qtResultsOpt.ResultsLocation = "C:\Automation\Example\Res1" qtTest.Run qtResultsOpt MsgBox qtTest.LastRunResults.Status qtTest.Close Set qtResultsOpt = Nothing Set qtTest = Nothing Set qtApp = Nothing ========================================================== This code is working fine, but Test Result window is not displaying after execution. Anybody can please help me regading the same. Thanks Akshaya Madali Capgemini India Pvt Ltd 9823213538
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
Give me diffrent script in QTP for Webpage(Java and .Net),WindowsBased Applications,Java application,.Net application...
Hi, I am new to QTP testing and was exploring the frameworks used for automation. I wanted help in writing various scripts and files for keyword driven automation like 1. Control File 2. Test Case File 3. Startup Script 4. Driver Script 5. Utility Script . etc It would be great if someone can give help in this context ... Thanks
if devloper change only button names in present build then script will execute or not , why? Only gui changed.......
1) after inserting the check point how to change the expected value that was captured while inserting the check point
1) What is the diff Between GetRoproprty and Gettoproperty? 2)What is Redim?
How many types of OBJECTS are there in QTP?
8 Answers Intel, Inter Globe Technologies,
How to run scripts 1,29,3,5,7,2 scripts using test batch runner in QTP.... Ie...I wanted to run scripts not in an order 1,2,3,4,5...like that How it is possible using test batch runner... I dont want hardcoded script