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 |
Scenario:2 combo boxes.1st combo contains a,b,c,d.2nd combo contains 10..20,20..30,30..40,.Selecting 'a' shld display 10...20,'b' shld display 20..30.. and so on.tell d script? 2.Random testing of 500 test cases in qtp?
how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and next day same page is having 60 links. if i run same programe it should display total links in webpage ?
New to QTP: In a qtp flight booking application, I tried to parameterize the to and from drop down lists using data table, depending on ur drop down selection it will pop up a list of flights. Here I am not finding a way to select flight randomly from given list... Thanks in advance guys.
How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an automation testing tool 12345' How should I know it is alphanumeric.Can any one please write the code for this
when to start the automation?
write string reverse prog using vb script with out using string reverse statement();
Read excel using qtp descriptive programing
How we test the logo or images in the web page using QTP? For example take google page, they change their logo for new year,christmas etc..How we test that? Plz answer this question... Thanks in advance..
your doing one project testing then how u know itis wheather web based application or windows based application?
i have .xls,.txt,.doc files are there (together). i want find only .xls file among them? how can we write function?
How to call a function in QTP?Is there any method ? Thanks , PRASANNA
any one can explain about QTP proocess,means where to start and how to start Scripting.