When ever QTP/UFT is unable to identify the object using the properties defined in the script or in Object Repository, the special machoism to identify the object using other properties is called Smart Identification.
Object Identification concept is based on 4 types of properties and a ordinal number.
Solution:- We need to take help of Smart identification here as Mandatory + Assistive(MA) properties are not able to find any unique properties (We are also ignoring Ordinal identifier )
Enabling Smart identification for an object :
Step 1:- Tools ---> Object identification
Step 2:- Select the Environment (In our case it is web as we need to configure for WebEdit )
Step 3:- Select the Test Object Class - Check the “Enable Smart Identification”----> Click “Configure”
Step 4:- Set the Base Filter and Optional Filter properties - Click “Add/Remove”
5.Taking the example of Web edit, in case we added it to OR with ESI disabled, enabling it for webEdit after that won’t made the already added webEdit to have ESI enabled and it’ll come as disabled in OR. But for newly added WebEdit it will be enabled
1. Mandatory property
2. Assertive property
3. Base filter property
4. Optional Filter property
QTP/UFT will learn the object in the following way
BY NOT SELECTING SMART IDENTIFICATION
Navigation ==> Tools ---> Object identification ----> uncheck smart identification
QTP/UFT will learn the mandatory properties of an object and check if these properties are sufficient to identify object uniquely. If it is sufficient, then it will stop learning further. Otherwise it will learn the first assertive property too and again check whether all these properties are sufficient to identify the objects uniquely. If sufficient, it stops learning. Otherwise it learns the remaining assertive properties one by one and checks (after each property is added) whether these properties are enough to identify object uniquely. This process continues till QTP/UFT identifies object uniquely or up to the end of assertive properties list. At the end of Assertive properties also, if QTP is unable to identify the object uniquely, then finally it will learn the Ordinal identifier and stops learning.
BY SELECTING SMART IDENTIFICATION
Navigation ==> Tools ----> Object identification -----> check smart identification
1. QTP/UFT will learn all the mandatory properties along with them it will also learn Base Filter and Optional Filter properties and store Base Filter Properties and Optional Filter Properties separately away from Object Repository and consider whether the Mandatory properties alone are sufficient to identify the object uniquely. If not sufficient it repeats the same process as above.
2. QTP/UFT will use all the properties (Mandatory properties, Assertive properties) present in Object Repository except Ordinal Identifier and try to identify the object uniquely. If it is unable to identify the object, then it will leave all the properties in Object Repository and use the Base Filter Properties, Optional Filter Properties. Consider all the Base Filter Properties at a time to identify the object uniquely (by matching these properties with the entire object present in application) If these properties are matched with more than one object, then it will form a list of all the objects matched and then consider the first Optional Filter Properties. It checks whether these properties are matching with objects present in the list. If this property also is matching with more than one object in the list, then it will form a new list of objects that are matched. Then, it will consider the second Optional Filter Property and check whether this property is matching with the objects present in the new list. If the property is matching with more than one object then once again the new list of objects is formed with all the objects that are matched, This process is continued till the new list contains one object or up to the end of Optional Filter Properties list. If still QTP/UFT fails to identify the object, then finally it will check whether Ordinal Identifier is available. If it is available, using that roughly object is identified.
If QTP/UFT successfully uses Smart Identification to find an object, the step is assigned a Warning status in the Test Results, and the result details for the step indicate that the Smart Identification mechanism was used. The step still receives a passed status.
If QTP/UFT cannot identify the object, then it stops the run session and displays run error message.
Examples:
How to enable and disable Smart identification
Scenario:- We need to capture an object (Say WebEdit) and we want UFT/QTP to uniquely identify the object but it is not able to find any unique properties to identify that, so how
can we go about it.
can we go about it.
Solution:- We need to take help of Smart identification here as Mandatory + Assistive(MA) properties are not able to find any unique properties (We are also ignoring Ordinal identifier )
Enabling Smart identification for an object :
Step 1:- Tools ---> Object identification
Step 2:- Select the Environment (In our case it is web as we need to configure for WebEdit )
Step 3:- Select the Test Object Class - Check the “Enable Smart Identification”----> Click “Configure”
Step 4:- Set the Base Filter and Optional Filter properties - Click “Add/Remove”
Step 5 :- Select the properties from Add/Remove Properties and click on Ok (We can define our new Property Also)
Verify Check:- To verify that enabled object it working as the settings, add object to Object Repository(OR) and check under “Object Properties” ->“Additional Details”->”Enable smart identification” is coming as “True”, in case it is not enabled “Enable smart identification”(ESI) will come as disabled.
Step 6:- Click on Ok button for opened screens, and we are done and now WebEdit will be identified smartly by UFT.
Important Points:-
1.Incase ESI, is enabled, we can disable this option for any particular object in OR, by making setting its value to “False”.
1.Incase ESI, is enabled, we can disable this option for any particular object in OR, by making setting its value to “False”.
2. For making this feature disabled for whole script, File->Settings->Run->”Disable Smart Identification during the Run session”
3.In point above, now UFT won’t rely on Smart identification during Run even we have set this feature enabled for any Object.
4.In case we added any object, with ESI as Off, UFT won’t use ESI for identification in future, even though we have enabled it after words.
5.Taking the example of Web edit, in case we added it to OR with ESI disabled, enabling it for webEdit after that won’t made the already added webEdit to have ESI enabled and it’ll come as disabled in OR. But for newly added WebEdit it will be enabled
No comments:
Post a Comment
Note: only a member of this blog may post a comment.