Results 1 to 3 of 3
  1. #1

    How do you retrieve text from a masked TextBox?

    I have a TextBox that is masked by ASCII character 108. It is used to accept a password from the user. After entering text into the TextBox, it is my understanding that I should be able to retrieve the actual text entered (non-masked) by calling the Text property (according to VBScript refernces). Unfortunately, when I enter a known text string, retrieve the text from the TextBox using the Text property, the comparison of the two values do not match. If I assign the value returned by the Text property to a variable and inspect it during a debug session, it appears to be holding the masked characters, not the actual string.

    So the question is, how do I retrieve the actual text that was entered into a password masked TextBox?


  2. #2

    Re: How do you retrieve text from a masked TextBox?

    I use a function similar to this to get a text property from our application.

    //C# script
    function GetText()
    var p, w, m;
    var string;
    p = Sys["Process"]("AppProcess");
    w = p["MainWin"];
    m = w["PropertiesForm"];

    string = m["txtProtectionPassword"]["wText"];


    It is important to note that our application will encrypt the password the user entered immediately after focus has left from the testbox. The encryption is then masked (in our case by ASCII 42)

    Using the function below returns the encrypted text, not the mask or the users entered text.

    After our company bought Test Complete we realized how easily a password in our application could be retrieved without encryption.

    So I'm kind of wondering if the application your testing is also encrypting and that is possibly why the strings do not match. But yes calling the Text property should return the proper value, unless the application is doing something different. - I'd ask your developers. Also, I would suggest that if your are able to get back the string that you entered with the text property that you have your developers start to use encryption for password fields.

  3. #3

    Re: How do you retrieve text from a masked TextBox?

    I will check into the application and control to make sure that encryption is not being performed.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:40 PM.

Copyright BetaSoft Inc.