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

Why you are Using Descriptive programming instead of Object Repository?

11 Answers  


Discuss QTP Environment.

1 Answers  


How should I check my code( Before going to execute) without executing the script in QTP

1 Answers  


what sort of things what u put in Bug Report ?

1 Answers  


What is the XML file architecture ?

0 Answers  






Can we directly automate test script according to requirements?

1 Answers  


Write the Test Cases for ATM(Any Time Money)

3 Answers   SpaceLabs,


In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the sentence and enter it into a field in a web application. How can I setup a parameter to enter in just a portion of the parameter (last word of the sentence) instead of the entire paramater (whole sentence).

2 Answers  


What are the two types of repositories available, explain them?

0 Answers  


What are the differences between qtp and winrunner?

0 Answers  


what is the difference between the modular framework and datadriven frame work

2 Answers  


What is DOM

2 Answers  


Categories