Forum Discussion

hkonakanchi's avatar
hkonakanchi
Occasional Contributor
29 days ago

System checks for Object for every test

I had two projects in my project suite where one project is created as a base where all my desktop objects and the corresponding action for each and every control is written

  • Controls are mapped in name mapping
  • Scripts are written with Aliases being used

I had created the second project where the scripts and name mapping from the first are used as it is and it includes some tests as well

It is some kind of framework setup where the first project as a base project ( a kind of page object pattern ) and the second one re-uses the script and name mapping as linked items from the first

If I am trying to run tests, each and every test tries to identify the objects that are declared as aliases in each script

For example if I have something like var notepadwnd = Aliases["notepad"], the system is trying to find notepad for the default amount of time for each test. 

My tests are getting timeout as I have atleast 20 application which are like this and TestComplete is trying to find them increasing the test duration and thus failing the test due to timeout

Is there anything that I am missing here 

 

    • hkonakanchi's avatar
      hkonakanchi
      Occasional Contributor

      Name mapping is done and it is fine. The only thing is tests are fine earlier as well. But after a latest update to Windows 11 24h2, each and every test is looking or searching for all the name mappings that are available 

      • scot1967's avatar
        scot1967
        Frequent Contributor

        Which version of TestComplete are you using and have you tried running a repair or removing and reinstalling TC?  If you feel the update has caused this problem opening an issue with support would be best. 

    • hkonakanchi's avatar
      hkonakanchi
      Occasional Contributor

      Name mapping is done and it is fine. The only thing is tests are fine earlier as well. But after a latest update to Windows 11 24h2, each and every test is looking or searching for all the name mappings that are available 

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    When it fails, what is the error in the log? 

    Do I understand your description correctly?
    -Project A has NameMapping and Script using aliases to that NameMapping. In Project A, from the script you can perform item highlight and it works.
    -In Project B, you add existing item of NameMapping and Script from Projact A, and from Project B script when you perform item highlight it fails. 

    • hkonakanchi's avatar
      hkonakanchi
      Occasional Contributor

      Name mapping is done and it is fine. The only thing is tests are fine earlier as well. But after a latest update to Windows 11 24h2, each and every test is looking or searching for all the name mappings that are available 

  • scot1967's avatar
    scot1967
    Frequent Contributor

    It would help to start with a few more details about the problem.

    "What is the exact error message you are receiving?"

    When it fails, what is the error in the log? 

    • In Tools\Current settings, there is an object search strategy.  
    • In Options\Engines there are name mapping settings.

     

    Have you checked for issues with your NameMap?  I have seen issues like this.  In one case the path set to the NameMap in the project '.mds' was the problem.  The '.mds' file should not be manually modified but can be opened and examined as XML. 

    In another case the NameMap was corrupt but I was able to recover by restoring an older NameMap from source control. 

    The NameMap itself is stored in a NameMapping.tcNM file.  This is also an XML file that can be examined but I would not recommend modifying the content. 

    In both cases this occurred in a situation similar to yours where two different projects were modifying the same NameMap.

    If you are still stuck you may want to open an issue with the support team.

     

  • scot1967's avatar
    scot1967
    Frequent Contributor

    Just to rule out the simplest question...  "If I am trying to run tests, each and every test tries to identify the objects that are declared as aliases in each script"  This is normal behavior.  If an object is found in one test is it not stored for use in other tests or if it doesn't have scope in the code block you are in.  

  • scot1967's avatar
    scot1967
    Frequent Contributor

    Here is another point of interest in Options\Engines\Name Mapping...

    Name Mapping Extended Search 

    Notes

    • Extended Find searches down the entire object hierarchy. The search is not depth-limited.
    • Extended Find uses breadth-first search, regardless of the value specified in the Object search strategy project property (it affects the Find methods only).
    • Searching for objects in large applications may take a long time. If you get warnings in the test log that a search takes too much time, try doing the following: