Tuesday, January 8, 2019


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




Related Posts:

  • Priority and Severity in Testing. Severity and Priority in Testing? As usually, Tester select Severity of bugs and Project lead or project manager selects bug priority. Priority - Priority is the order in which developer has to fix the bug. Severity … Read More
  • UFT Real time Scripts 2020 For more QTP Realtime Scripts,  MS Excel Scripts '''Script to create a new excel file , write data '''save the file with read and write protected '''''pwd1 is for read protected pwd2 is for write protected Set xl=Crea… Read More
  • UFT 220 interview questions 2020 UFT 220 interview questions and answers 2020 Automation testing UFT 220 interview questions and answers 2020 Q. 1: What is Automation Object Model in QTP? Like we use QTP for automating the testing of our applications, we … Read More
  • Tell me about yourself Outline in Software Testing Outline Tell me about yourself in Software Testing  Ø  How long you’ve been working in the field Ø  What you’ve done as a QA Professional o   SDLC Phases o   Methodologies you’ve work… Read More
  • UFT Keyboard Shortcut commands UFT Keyboard Shortcut commands  Frequently Used Shortcut keys: To comment block of statements: Ctrl+M To uncomment block of statements: Ctrl+Shift+M To apply “With” to script: Ctrl+W To remove “With” from script: Ctrl… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,854

Blog Archive