Micro Focus QTP (UFT) Forums
Getting text from password edit box - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Getting text from password edit box (/Thread-Getting-text-from-password-edit-box)

Pages: 1 2


Getting text from password edit box - laura - 07-14-2009

Hi All

I need to get visible text from a password edit box. But the text is coming up in an encrpted format how can i un encrrpt the text? so i can check if i have the right password in box.

thanks


RE: Getting text from password edit box - Ankur - 07-14-2009

There is no way we can "decrypt" the passwords generated. I guess this will fail the basic purpose of having pwds.

I can suggest you a simple solution though:
Just check whether you are able to go to the next screen after entering password or check if there is no error message after entering pwds. if there is either of two, you can be sure that you have entered the right password.


RE: Getting text from password edit box - QTPgrd - 07-15-2009

I have a suggesstion for getting the password entered Password field. Hope the following script may help you.........

-----------------------------------------
Code:
Browser("B").Page("P").WebEdit("uname").Set "tester"
Browser("B").Page("P").WebEdit("pwd").SetSecure "4a5d7145b2fef00c64034e56dc213cbdf0da"
[b]A = Browser("B").Page("P").WebEdit("pwd").GetROProperty("Value")
MsgBox (A)[/b]
-----------------------------------------
Thanks


RE: Getting text from password edit box - supputuri - 07-15-2009

Hi QTPgrd,

i am sorry to say that the LOC that you specified won't workout. As the value will return empty. so, i will agree with Ankur in this regard.


RE: Getting text from password edit box - QTPian - 07-15-2009

Hi QTPKing,

The script provided by QTPgrd is working fine for me. I didn't find any discrepancies in the value returned.

Thanks,


RE: Getting text from password edit box - sharingwilddreams - 07-15-2009

Dear Laura

Answer replied by QTPGRD is 100 % right,I have used that in so many pages.


RE: Getting text from password edit box - laura - 07-15-2009

Really? I tried it and all am getting is an empty msg box.


RE: Getting text from password edit box - supputuri - 07-15-2009

Hi friends,

Let us see indetail.
1) If you are entering a password with 4 chars like "P@ss" then the encrpty will be "4a5dcde055cbebeecd93bb8628e0" i.e. 28 charecters
2) when you enter the same 28 charecters using setsecure we can see only 4 chars in Password field.(****)
3) When you get the visible text or value from password edit box then there may be 2 cases
Case:1: We won't get any value (as specified by me in previous post)
Case:2: if at all we got the value the number of char's will be 4 only. Though the number of chars are 4 they not either "P@ss" or "a5dcde055cbebeecd93bb8628e0".

So guys, QTPian and sharingwilddreams please let me how i am wrong and let me know if i am going in wrong way.


RE: Getting text from password edit box - sharingwilddreams - 07-15-2009

Lets clear the confusion.
Answers posted by me and other guy was on the issue abt masked characters,thats the password getting hidden using asterisks or something like that. If this is the case,what answer he has given is right. Encryption and Decryption of passwords r out of the context.


RE: Getting text from password edit box - QTPgrd - 07-15-2009

Hi QTPKing

Please try the below script. This script has been recorded with our Forum.
--------------------------
Code:
Browser("SRAIS-AS Login").Page("QTP Forums").Link("Login").Click
Browser("SRAIS-AS Login").Page("QTP Forums").WebEdit("quick_username").Set "QTPgrd"
Browser("SRAIS-AS Login").Page("QTP Forums").WebEdit("quick_password").SetSecure "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
A = Browser("SRAIS-AS Login").Page("QTP Forums").WebEdit("quick_password").GetROProperty("Value")
Msgbox (A)
Browser("SRAIS-AS Login").Page("QTP Forums").WebButton("Login").Click
--------------------------
In the message box you would receive the password entered in the Password text field, say if you have entered password something like "QTP000" this would be displayed in the message box