For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
Course Name Date Time Duration Type Location
An important update from QtpSudhakar. I stopped giving classroom training in MindQ Systems. I have bigger plans and I want to put an end to regular classroom training because very less people are practicing. From now onwards every session of mine is going to have explanation and practice. Everyone should practice in presence of mine and should go out of classroom with practical knowledge. So I started my own institute AnyTechLabs in Madhapur. Please reach out to +91-8328152362 for course details. Visit AnyTechLabs.com for address details.
Selenium + Cucumber 24th October 7.30 AM IST to 9.00 AM IST 45 Days WeekDay Online

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Sunday, August 29, 2010

All about Validation of Editbox – Part-3 - Verify ClipBoard Text Acceptance

This article is the continuation of my previous post All about Validation of Editbox – Part-2. This will discuss about verifying edit box clipboard text acceptance.

When testing some secured application we can observe some functionalities like blocking right click on the pages and disabling clipboard text acceptance for text fields.

We can automate these type of situations by using windows script host sendkeys method.

'Clipboard Text Rejection
Function VerifyClipBoardTextNotAcceptance(oTestObject)

 'Declare Variable
 Dim wShell
 'Set empty value in edit box
 oTestObject.Set ""
 'Hilight the edit box for entering text
 'Send Ctrl+v to edit box
 Set wShell=CreateObject("wscript.shell")
 wShell.SendKeys "^v",1
 'Verify for the empty value in edit box
 If oTestObject.GetROProperty("value")<>"" Then
  Reporter.ReportEvent micFail,"VerifyClipBoardTextNotAcceptance","TextBox Accepted Clipboard Text"
  Reporter.ReportEvent micPass,"VerifyClipBoardTextNotAcceptance","TextBox not Accepted Clipboard Text"
 End If

End Function

'Using Function in Script
Set EditObj=Browser("").Page("").WebEdit("")
VerifyClipBoardTextNotAcceptance EditObj


RegisterUserFunc "WebEdit","VerifyClipBoardTextNotAcceptance","VerifyClipBoardTextNotAcceptance"


UnregisterUserFunc "WebEdit","VerifyClipBoardTextNotAcceptance"

Please send your Suggestions and Doubts to my yahoo group http://in.groups.yahoo.com/group/qtpsudhakar

No comments :

Post a Comment