Hi can anyone pls suggest how to fetch username(system
login name)and system name in to qtp.I am not using TD or
QC.Thx

Answers were Sorted based on User's Feedback



Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am n..

Answer / anonymous

I think, this works...
But make sure before using it...

xx = Dialog("Login").WebEdit("userName").GetText
'GetText gives you the text from the Edit Box- I think...
msgbox xx

Is This Answer Correct ?    0 Yes 0 No

Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am n..

Answer / siva reddy (us)

var=dialog("Login").winedit("username").getvissibletext

Is This Answer Correct ?    0 Yes 0 No

Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am n..

Answer / nreddy

I got the answer.This will work.The one you posted is
You are trying to fetch from dialog box where you have user
name displayed.But this code will fetch from system.
'-----------------------
Dim sys
Set sys = CreateObject("ADSystemInfo")
msgbox "UserName: "& sys.UserName
msgbox "Computer: " & sys.ComputerName
'------------------------

Is This Answer Correct ?    0 Yes 0 No

Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am n..

Answer / venkatesh babu

MsgBox Environment.Value("UserName")

Is This Answer Correct ?    0 Yes 0 No

Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am n..

Answer / pavani prasad

Hi N Reddy,

we use use environment variable for fetching username
(system login name).

u can try this

msgbox environment.Value("UserName")

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Hi Guys, I want to place all of my values which i am getting it from a loop in to a global shee. For that i had written the script like this For i = 1 to ECOs-1 ECO = List(i).GetROProperty("innertext") DataTable.AddSheet("ECOList") DataTable.GetSheet("ECOList").AddParameter "ECOList",ECO AbortECO = DataTable.GetSheet("ECOList").GetParameter ("ECOList").Value msgbox AbortECO DataTable.GetSheet("ECOList").SetNextRow Using the above script, whenever the loop iterates it is creating new column "ECOLIST" in the sheet called "ECOLIST". It means, the values are displaying in the column wise even though i added the script " DataTable.GetSheet("ECOList").SetNextRow" . The cursor is not moving to the next line. Anybody help me out how to pass the values from script to the excel(Global/Local) sheet. Pls let me know @ nbabu11@gmail.com if you are not clear about the question.

0 Answers  


What are accessibility check point and xml check point?

5 Answers   IBM,


dears, I have one question for QTP.If my software is english and defined objects is english name. But, if my software has support MUI, under this case that my objects in the QTP can't work, because the QTP can't catch the objects name. In this case, is anybody know how to solve this problem? Thanks a lot.

2 Answers   CyberLink,


How do you perform Regreession Testing?

0 Answers   Nokia,


How to open an application through scripting?

11 Answers  






What are the Features & Benefits of Quick Test Pro ?

0 Answers   Crea,


How do u insert an object during runtime in qtp?

2 Answers  


How to launch application under test through VBscript without using systemutil.run or invokeapplication?

3 Answers  


How u send bugs to dev'lpment team all at once or one by one or waht is the process?

2 Answers   kenexa,


I want to assign values in a table in my software, in first column i will give values, table is of 4x4 i.e 4 row and 4 columns, i m using VBScript in my automation work. it is a simple table for giving values.

4 Answers   TCS, Wipro,


How can we fill data in a text box without recording using object spy. Can you please provide the steps...

1 Answers   Hotel Jobs, TCS,


What exactly is the difference among all the three recording modes.

5 Answers   Accenture,


Categories