Checkproperty method in QTP:
Automation tool itself does not find and report new bug(s) efficiently.It requires a skill of automation tester to let tool perform the operation in an efficient manner.We generally verify that application performs as expected;and if not,then report warning or info or error.Power of automation is unleashed only when we understand the thin line(hypothetical) that is between manual test and automation tool(s).I call this line as Auto-Manual bridge.I work out there.
Rolling back to topic again: There are different methods and properties available for checking/verifying.Exist,checkproperty, getROProperty etc.Let’s discuss Checkproperty method.We often come across a situation to verify the status of page load, test entered on the text box and similar scenarios.Checkproperty methods is very handy to solve the above problems easily.
Example:
Syntax:object.CheckProperty (PropertyName, PropertyValue, [TimeOut]) Example 1.Check the status of page. >Browser("micclass:=Browser").Page("micclass:=Page").Object.CheckProperty ("status","done",3000) Example 1.Verify the text Automationlab09 has been entered on the name textbox. >Browser(“micclass:=Browser”).Page(“micclass:=Page”).WebEdit(“name of text box”).Set “Automationlab09” sCheck=Browser(“micclass:=Browser”).Page(“micclass:=Page”).WebEdit(“Name”).CheckProperty (“value”, “Automationlab09”)
Here (in example 1), Quick test verifies whether the status on the status bar of browser is displayed as “done” or not. It waits till the timeout period ie. 3 seconds(in milliseconds),If it is unable to verify the status within 3 seconds then it’ll use the default time period specified in test settings.If verification is successful within time period it’ll return a boolean value TRUE and report test status as “PASSED” on test results else it’ll return boolean value FALSE and report the test status as “FAILED” on test results viewer.
This is an alternative way of using checkpoint in descriptive programming.