Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Application Program Interviews:AutoCADBEA WeblogicBioinformaticsBizTalk ServerBug Tracking ToolsBugzillaClarify CRMCoding StandardsComputer Aided Design (CAD) DesignerCVSGIMPJMXLINQLoadRunnerMagentoMATLABMicrosoft AccessMicrosoft ExcelMicrosoft OfficeMicrosoft OutlookMicrosoft WordModel View Controller (MVC)OLAPOOADQuickbookRational RobotRDFSchemaSiebelSilkTestSVGTest PlanTesting ToolsUnity 3D DeveloperVRMLWCF SDKWPFXML DOMXPointer
Copyright © 2018. All Rights Reserved
SilkTest Interview Question:
How to Setting Max value?
Submitted by: AdministratorHere's the function you need to verify that an object (TextField) accepts a max char limit.
[code]
[+] boolean VerifyMaxChars (window wTarget, integer iMax, string sChar optional)
[ ]
[ ] string sText = ""
[ ] string sComp
[ ]
[+] if sChar == null
[ ]
[ ] sChar = "A"
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax)
[ ]
[ ] wTarget.TypeKeys (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText != sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {Len (sComp)}")
[ ]
[ ] return false
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax + 1)
[ ]
[ ] wTarget.SetText (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText == sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {iMax + 1}")
[ ]
[ ] return false
[ ]
[ ]
[ ] return true
[ ]
[/code]
Submitted by: Administrator
[code]
[+] boolean VerifyMaxChars (window wTarget, integer iMax, string sChar optional)
[ ]
[ ] string sText = ""
[ ] string sComp
[ ]
[+] if sChar == null
[ ]
[ ] sChar = "A"
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax)
[ ]
[ ] wTarget.TypeKeys (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText != sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {Len (sComp)}")
[ ]
[ ] return false
[ ]
[ ]
[ ] sText = Replicate (sChar, iMax + 1)
[ ]
[ ] wTarget.SetText (sText)
[ ]
[ ] sComp = wTarget.GetText ()
[ ]
[+] if sText == sComp
[ ]
[ ] Verbose ("Verify Max Chars failed, expected number {iMax}, actual {iMax + 1}")
[ ]
[ ] return false
[ ]
[ ]
[ ] return true
[ ]
[/code]
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.