Micro Focus QTP (UFT) Forums
problem about SetSecure - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: problem about SetSecure (/Thread-problem-about-SetSecure)



problem about SetSecure - stevol - 06-03-2008

Hi,
I have written the following code with a login in website, and i use 'setsecure' for the password (exactly as when i register the code), but i don't understand why in the pwd field on the website i have only 1 hidden character and nothing else [when i register the code i have number of hidden characters equal to the number of characters of the password, that is '4' in the example below]. Any idea? (I presume this is the reason why then code fails the login)

Code:
Dim brow, pag, webuser, webpwd
Set brow     =Browser("name:=Vodafone")
Set pag      =brow.Page("title:=Vodafone")
Set webuser  =pag.WebEdit("default value:=Username", "name:=username","html tag:=INPUT","type:=text","index:=0")
'Set webpwdtxt=pag.WebEdit("name:=passwordTxt","html tag:=INPUT","type:=text")
Set webpwd   =pag.WebEdit("name:=password","html tag:=INPUT","type:=password","index:=1")

Dim user, pwd
user="abcd"
pwd="1234"

URL="http://www.vodafone.it"
SystemUtil.run "iexplore",URL
pag.Sync
webuser.Set user
webpwd.SetSecure pwd

Thank for every help


RE: problem about SetSecure - Anshoo Arora - 06-04-2008

Go to Start -> All Programs -> QuickTest Professional -> Tools -> Password Encoder

Enter the string that you want encoded. Copy/Paste that to pwd. This will be the actual Secure String for your password.

I am not sure if this is going to help solve this issue, but if it persists, please post here. Also, what happens if you do the same process manually?


RE: problem about SetSecure - stevol - 06-05-2008

hi,
thanks for the suggestion, i'll prove it asap :-)
about other tests, i have noticed that in particular with pwd=12345678, or pwd=111111, or also alphanumeric pwd with more than 10 characters, i have no problems... the problem is with this pwd="1234567890" (in the first post i had had only '1234')
[i have proved also converting with cstr(pwd), just as attempt..]
In the manual test the normal copy/paste is correct... only in automatic run with 1234567890 i have had problems.


RE: problem about SetSecure - Anshoo Arora - 06-05-2008

Try using:

pwd = 1234567890

instead of

pwd = "1234567890"


RE: problem about SetSecure - stevol - 06-05-2008

hi,
with the encryption ("48478e5df72e62b93bf04ef076401ac4d49efac330fa03572492" instead of "1234567890") the login functions :-)
With 1234567890 or "1234567890" the result is the same (it fails).
But with other user/pwd, not encrypted, the login functions... so i don't understand why with "1234567890" no.
thanks


RE: problem about SetSecure - somisays - 06-05-2008

Dear stevol,
Can you pls what is max charecters for the Password filed in the application.

Regards
Sridhar


RE: problem about SetSecure - stevol - 06-06-2008

the max number is 20 characters (i have proved alphanumeric password with more 10 characters, with success).
Maybe the user is 'dirty'