You are on page 1of 8

Recovery Scenarios:

Unexpected events, errors, notifications, app crashes during run session can stop the execution prematurely and effect at worst where the automation suite is running unattended. To, overcome the situation QTP provides a feature called Recovery Scenarios. R.C consists of : 1. Trigger Event Event that interrupts run session like unwanted pop-up, error notification, application crash . 2. Recovery Operation An operation which is performed to enable QTP to continue the run session even when triggered event firesd/interrupt the run session. For e.g. clicking on OK button ow popup, restarting windows etc. 3. The instructions on how QuickTest should proceed after the recovery operations have been performed, and from which point in the test QuickTest should continue, if at all. For example, you may want to restart a test from the beginning, or skip a step entirely and continue with the next step in the test.

Smart Identification
If QTP is unable to find any object that matches the learned object description, or if it finds more than one object that fits the description, then QuickTest ignores the learned description, and uses the Smart Identification mechanism to try to identify the object. When QTP is unable to identify the object with the defined properties in OR, Quickest uses the Smart Identification definition (if defined and enabled) to identify the object. Using Smart Identification dialog box , we can create and modify the Smart Identification definition that QTP uses for a selected test object class.

The Smart Identification mechanism uses two types of properties:

Base Filter Properties. The most fundamental properties of a particular test object class;
those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from <A> to any other value, you could no longer call it the same object. Optional Filter Properties. Other properties that can help identify objects of a particular class. These properties are unlikely to change on a regular basis, but can be ignored if they are no longer applicable.

Read-Line Method Usage


Function ReadLineTextFile Const ForReading = 1, ForWriting = 2 Dim fso, MyFile Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForWriting, True) MyFile.WriteLine "Hello world!"

MyFile.WriteLine "The quick brown fox" MyFile.Close Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForReading) ReadLineTextFile = MyFile.ReadLine ' Returns "Hello world!"

End Function

Dictionary Object:

Methods

1. Add Method (Dictionary) a. object.Add (key, item)


Dim d Set d d.Add d.Add d.Add ' Create a variable. = CreateObject("Scripting.Dictionary") "a", "Athens" ' Add some keys and items. "b", "Belgrade" "c", "Cairo"

2. Exists Method
Set d = CreateObject("Scripting.Dictionary") d.exists(keyname) Returns true if key exists and False when not.

3. Items Method Returns an array of all the items that exists in dictionary. 4. Keys Method Returns an array of all the keys that exists in dictionary.

5. Remove Method d.remove(key) Removes a key, item pair from a Dictionary object. 6. RemoveAll Method The RemoveAll method removes all key, item pairs from a Dictionary object.
Properties

7. Count Property 8. Item Property 9. Key Property

Object Model Diagram

FileSystemObject Object
Provides access to a computer's file system. 1. BuildPath Method 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. CopyFile Method CopyFolder Method CreateFolder Method CreateTextFile Method DeleteFile Method DeleteFolder Method DriveExists Method FileExists Method FolderExists Method GetAbsolutePathName Method GetBaseName Method GetDrive Method GetDriveName Method GetExtensionName Method GetFile Method GetFileName Method GetFolder Method GetParentFolderName Method GetSpecialFolder Method GetTempName Method MoveFile Method MoveFolder Method OpenTextFile Method

Elegant

You might also like