Forum Discussion

laxmikanth's avatar
laxmikanth
Frequent Visitor
2 years ago

TypeError: Cannot read property 'Name' of null

I have integrated testcomplete with azuredevops i have executed testcases but some testcases are failed getting below error ,

TypeError: Cannot read property 'Name' of null

 

3 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Does the 'Name' property exist? What is the property value of 'Name'? Are you checking the null values? What actions are you performing to get this error?

  • KB1's avatar
    KB1
    Champion Level 2

    I experienced a comparable situation yesterday as well. It is possible that there is an issue with your execution plan. I would recommend carefully reviewing the parameters you have provided.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Cannot read property 'Name' of null

    This means that the object that is expected to provide Name property was not found/does not exist.

    Sample pseudocode:

    var obj = page.FindChildByXPath("non-existing XPath"); // object does not exist and null is assigned to obj variable

    Log.Message(obj.Name); // this will fail with the above error