fbpx

How are we encrypting in ZAP-fiX?

How are we encrypting in ZAP-fiX?

Home Forums ZAPTEST Old Posts How are we encrypting in ZAP-fiX?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30669
    Curtis Don
    Participant

      Hello Zap,

      We are using the Zap-fix UFT Addin.
      We can to a new problem:
      How can we encrypt a text (Like password) in a captured Zap-fix object?
      We know how to do it in ZAPTEST and in UFT itself, but the UFT’s "SetSecure" method does not appear in Zap-fix objects’ methods list.

      Please help.

      #30670
      Sasha ZAP
      Moderator

        Hello CurtisDo,

        Thank-you for your question.

        Basically there is no build-in method in Zap-fix methods’ library which deals with encrypting text, therefore you can consider one of the following 3 possible solutions:

        1. Usually text-fields which require encryption can be added as known objects (Not a Zap-fix based objects) to the UFT’s Object Repository, once such was added you can use the UFT’s "SetSecure" method upon it (And all other known UFT encryption manipulations).

        2. If an AUT’s objects (AUT = Application Under Test) cannot be recognized by UFT, we are strongly recommend to use our standalone ZAPTEST testing app, in it you have the "TypeEncrypted" method.

        3. If you still want to use UFT and the Zap-fix objects you can try implementing VBScript code, such as the following:

        ‘encrypt.vbs
        set x = WScript.CreateObject("WScript.Shell")
        txt = inputbox("enter text to be encoded")
        msgbox encode(txt)
        x.Run "%windir%notepad"
        wscript.sleep 1000
        x.sendkeys encode(txt)

        function encode(s)
        For i = 1 To Len(s)
        newtxt = Mid(s, i, 1)
        newtxt = Chr(Asc(newtxt)+3)
        coded = coded & newtxt
        Next
        encode = coded
        End Function

        ‘decrypt.vbs
        set x = WScript.createobject("wscript.shell")
        txt = inputbox("enter text to be decoded")
        msgbox encode(txt)
        x.Run "%windir%notepad"
        wscript.sleep 1000
        x.sendkeys encode(txt) function encode(s)
        For i = 1 To Len(s)
        newtxt = Mid(s, i, 1)
        newtxt = Chr(Asc(newtxt)-3)
        coded = coded & newtxt
        Next
        encode = coded
        End Function

        Please contact Zap for further help.

        Thanks,
        Sasha

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      Virtual Expert

      ZAPTEST

      ZAPTEST Logo