Friday, August 10, 2012

QTP Crypt Object


Crypt Object in QTP is used to Encrypt the given password, This scenario is just to confirm whether the given password is saving as Encrypted, This object is used in different ways in different methods,
Below scripts are done for a sample login page, to show how the given password is encrypted before the page get login

SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE",
"test.sso.com"
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebEdit("txtUserName").
Set"68testuser1"
pwd="abc123"
e_pwd=Crypt.Encrypt(pwd)
msgbox e_pwd
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebEdit("txtPassword").SetSecure e_pwd
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebButton("Login").Click
Browser("IdPInitiated:Identity").Page("SPInitiated:Identity Provider").WebButton("Goto Sdp").Click

















Before the password is getting entered it gets encrypted and shows the encrypted text in the (msgbox) as we declared in the script, Once the 'OK' button is clicked from the msgbox, the password get entered in to the password field for the next step to the login.

There is another method the password get encrypted directly to the password field for login by declaring below variable in different object method

SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE",
"test.sso.com"
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebEdit("txtUserName").
Set"68testuser1"
password = "abc123"
sEncryptedPwd = Crypt.Encrypt(password)
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebEdit("txtPassword").Set"abc123"
Browser("IdPInitiated:Identity").Page("IdPInitiated:Identity").WebButton("Login").Click
Browser("IdPInitiated:Identity").Page("SPInitiated:Identity Provider").WebButton("Goto Sdp").Click

9 comments:

  1. Gain hands-on skills with tableau developer training designed to build interactive dashboards and data-driven insights.

    ReplyDelete
  2. Master the salesforce admin course to manage users, automate workflows, and customize Salesforce with confidence.

    ReplyDelete
  3. Master your CRM skills with a salesforce development course designed to teach real-world customization, automation, and app building.

    ReplyDelete
  4. "Boost your career with our comprehensive salesforce admin training
    , designed to equip you with essential skills to manage and optimize Salesforce effectively."

    ReplyDelete
  5. "Enroll in salesforce developer training

    to master platform customization, Apex coding, and Lightning components for a successful career."

    ReplyDelete
  6. "Boost your career with salesforce admin course
    designed for beginners and professionals alike. Learn to manage Salesforce efficiently and unlock new opportunities in the CRM world."

    ReplyDelete
  7. "Enhance your data analytics skills with power bi online training
    designed for beginners and professionals alike. Learn to create interactive dashboards, insightful reports, and master data visualization at your own pace."

    ReplyDelete
  8. "Boost your career with salesforce development course
    designed to teach hands-on skills in Apex, Visualforce, and Lightning components."

    ReplyDelete