Ask a Question

TypeError: Cannot read property 'Navigate' of null

SOLVED
KB1
Frequent Contributor

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




9 REPLIES 9
rraghvani
Trusted Contributor

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
Frequent Contributor

kevinbenson_0-1670847973399.png

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

kevinbenson_1-1670847982432.png

 

rraghvani
Trusted Contributor

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
Frequent Contributor

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
Trusted Contributor

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

rraghvani_0-1670853843824.png

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

rraghvani_1-1670854163856.png

Select the last option

rraghvani_3-1670854256328.png

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
Frequent Contributor

Yess, I did all the namemapping over again.

Thank you for this tip

rraghvani
Trusted Contributor

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

rraghvani_0-1671715088565.png

 

KB1
Frequent Contributor

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
Trusted Contributor

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.

 

cancel
Showing results for 
Search instead for 
Did you mean: