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

How will you find the current time of the remote machine using QTP script?

0 Answers  


In Test Director bug rEPORTS, wHAT ARE THE CONTENTS(fIELDS)? iF yoU PREAPARE BUG REPORT IN eXCEL sHEET , hOW U SEND TO dEVELOPMENT TEAM THRW T.D?

1 Answers  


Your roles and responsibilities and daily tasks? (As automation tester)

0 Answers   Oracle,


when i perametarization of the test through outputcheckpoint,i have seen run time error i.e outputcheckpoint mismatch .Plz tell anybody to me(qtp).How to clear that?

1 Answers  


How many types of recording modes in qtp? Describe each type with an example where we use them?

0 Answers  






What will be happen if i load object repository at run time, but it has already associated.

0 Answers   NTT Data,


What is difference b/w AOM,DOM,COM Have u ever is used ny of the models.If so why?

1 Answers   GE,


How Does Run time data (Parameterization) is handled in QTP?

2 Answers   Crea,


give me the code for check point for validating application

1 Answers  


in which case & which method we can use "native" property of an object ?

1 Answers  


if you have the same application screen with 7 drop down boxes and approximately 70 values how do you test with QTP?

2 Answers   Ordain Solutions,


What are the Latest Feature are added In QTP 9.2?

2 Answers   Infotech,


Categories