Forum Discussion

r12_aparna's avatar
r12_aparna
Occasional Contributor
12 years ago

Object browser and name mapping objects

Hi,



I am trying to maintain the original script in test COmplete 8.0 version. When I execute a routine, it has several errors popping up.



1. Object does not exist, though it exists in object browser and mapped to right object in name mapping window.

"Unable to get the control's property, since the control does not exist anymore.



Tested object:

Sys.Process("PurchaseExpressPremium").WPFObject("HwndSource: ShellWindow", "PurchaseExpress Premium").WPFObject("ShellWindow", "PurchaseExpress Premium", 1).WPFObject("RootWorkspace").WPFObject("ModuleLayoutView", "", 1).WPFObject("FeatureWorkspace").WPFObject("FeatureLayoutView", "", 1).WPFObject("FeatureDetail").WPFObject("LineItemDetailLayoutView", "", 1).WPFObject("LineItemDetails_LineItemDetail").WPFObject("OrderLineItemDetailView", "", 1).WPFObject("LineItemExpander", "Line Items for Order", 1).WPFObject("LIDGridUserControl").WPFObject("LidGrid").WPFObject("DataRow", "", 1).WPFObject("DataCell", "", 2).WPFObject("AutoSelectTextBox", "", 1)"







A similar error to the above:



Unable to get the control's property, since the control does not exist anymore.



Tested object:

Sys.Process("PurchaseExpressPremium").WPFObject("HwndSource: ShellWindow", "PurchaseExpress Premium").WPFObject("ShellWindow", "PurchaseExpress Premium", 1).WPFObject("RootWorkspace").WPFObject("ModuleLayoutView", "", 1).WPFObject("FeatureWorkspace").WPFObject("FeatureLayoutView", "", 1).WPFObject("FeatureDetail").WPFObject("LineItemDetailLayoutView", "", 1).WPFObject("LineItemDetails_LineItemDetail").WPFObject("OrderLineItemDetailView", "", 1).WPFObject("LineItemExpander", "Line Items for Order", 1).WPFObject("LIDGridUserControl").WPFObject("LidGrid").WPFObject("DataRow", "", 1).WPFObject("DataCell", "", 4).WPFObject("PART_CellEditorBoundControl")



Can somebody please help me on how to handle the error. I am new to test complete and was given a task to fix this.



Thanks,

Aparna







  • The quick fix is to capture the mapping of the objects that throw up errors using the Object Spy and update your script. The long term preferred solution is to make your tests more dynamic using wildcards and unique identifiers.



    I had this problem when I first started using TestComplete as well. It turned out that in my case, I was using a different browser which I hadn't anticipated...so I adjusted the test to the new mapping and the object was identified; all was good.



    Then it happened again...this time the developers has changed something...found out what they had changed (AND opened up a channel of communication with them for when something like this changes...) then adjusted the test to the new mapping so object was identified and all was good again.



    The last time it happened, it was the result of the test executing too quickly and not allowing the web application to execute its behind the scenes interface changes. It didn't happen when I made the test and the few times I ran it; but then it happened when our VM slowed down. I added some delays between clicks and all was well once again.



    To avoid the problem, update your tests to use wildcards wherever you think a value might change. I find that you shouldn't using Name Mapping too extensively with web application testing; not because it doesn't work well, but moreso because web application objects change too frequently. I prefer to use the 'Find Object' operation with 'ObjectIdentifier' as the primary way to locate objects in a web application.



    In the case of your first example, you might be able to just use:



    *WPFObject("AutoSelectTextBox", "", 1)"



    Then, if the position/mapping changes, the test will still find the object you are looking for. This will only work with the 'Find Object' operation.
  • The quick fix is to capture the mapping of the objects that throw up errors using the Object Spy and update your script. The long term preferred solution is to make your tests more dynamic using wildcards and unique identifiers.



    I had this problem when I first started using TestComplete as well. It turned out that in my case, I was using a different browser which I hadn't anticipated...so I adjusted the test to the new mapping and the object was identified; all was good.



    Then it happened again...this time the developers has changed something...found out what they had changed (AND opened up a channel of communication with them for when something like this changes...) then adjusted the test to the new mapping so object was identified and all was good again.



    The last time it happened, it was the result of the test executing too quickly and not allowing the web application to execute its behind the scenes interface changes. It didn't happen when I made the test and the few times I ran it; but then it happened when our VM slowed down. I added some delays between clicks and all was well once again.



    To avoid the problem, update your tests to use wildcards wherever you think a value might change. I find that you shouldn't using Name Mapping too extensively with web application testing; not because it doesn't work well, but moreso because web application objects change too frequently. I prefer to use the 'Find Object' operation with 'ObjectIdentifier' as the primary way to locate objects in a web application.



    In the case of your first example, you might be able to just use:



    *WPFObject("AutoSelectTextBox", "", 1)"



    Then, if the position/mapping changes, the test will still find the object you are looking for. This will only work with the 'Find Object' operation.
  • r12_aparna's avatar
    r12_aparna
    Occasional Contributor
    Thanks Andrew..That has solved my problem. Now my script runs successfully. I have another question - My TC license is expiring today and i wanted to know if I can run the scripts nromally and change the code side by.



    Thanks