Forum Discussion

KB1's avatar
KB1
Champion Level 2
2 years ago
Solved

TypeError: Cannot read property 'Navigate' of null

I accidentally deleted all of the  namemapping objects.
and after setting the back up back into testcomplete i keep getting this error with every step.

This happens at the very first step.

 

 

JavaScript runtime error.

TypeError: Cannot read property 'Navigate' of null




  • For the web application I'm automating, extended find is disabled,

    I only map the names for the controls I'm interacting with only - e.g. right click on the control and select Map Object

    Select the last option

    I let TC choose the default names, but the last item name I change to something meaningful. Once my objects are all mapped, I then drag them into Aliases mapped object to build a tree structure

     

    I do scripting, and this is the best method I have found, that works for me. I also use TFS as source control.

     

9 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    For the web application I'm automating, extended find is disabled,

    I only map the names for the controls I'm interacting with only - e.g. right click on the control and select Map Object

    Select the last option

    I let TC choose the default names, but the last item name I change to something meaningful. Once my objects are all mapped, I then drag them into Aliases mapped object to build a tree structure

     

    I do scripting, and this is the best method I have found, that works for me. I also use TFS as source control.

     

    • KB1's avatar
      KB1
      Champion Level 2

      Yess, I did all the namemapping over again.

      Thank you for this tip

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Something is using the word "Navigate", which hasn't been initialised, and TC doesn't like empty values. You'll need to find this and correct it.

     

    • KB1's avatar
      KB1
      Champion Level 2

      All my name mapped objects are gone.... how do I fix this?

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    From your screenshot, you do have name mappings. I'm guessing the references have been broken, which most likely means you'll have to delete and recreate the name mappings again.

     

    If you click on Update, on the name mapping, does it update correctly?

     

    Unfortunately, there's no other ways of recovering this, if you're not using source control or have Windows file history enabled.

     

     

    • KB1's avatar
      KB1
      Champion Level 2

      No it does not update it only shows red. and hours and hours of testmaking is just down the drain.....


      what is a fast way to get all the name mapping right?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I forgot to mention, I don't use XPath in my projects

     

    • KB1's avatar
      KB1
      Champion Level 2

      Is there a reason why you don't use xPaths? is there a simpler way to point to objects in testcomplete? In my environment some Fields got the same label or id.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I don't do cross browser testing, and our tool only supports Windows. I also found xpath not being able to identify the exact UI objects I wanted - majority of all out UI object don't have ID's.