Forum Discussion

Nilam's avatar
Nilam
Occasional Contributor
8 years ago

You are trying to call the "Click" method or property of the "item" object that does not exist.

You are trying to call the "Click" method or property of the "item" object that does not exist. This additional information comes when i search a web element using "page.NativeWebObject" and also in ...
  • shankar_r's avatar
    8 years ago

    Hi,

     

    Basically, The error message says the object you are trying to Click is not exists in your page.

     

    Always good to check exists then do the operation as like below,

     

    function clickObject(){
          var pageObject = page.FindChildByXpath("<your xpath>");
          
          if(pageObject.Exists){
                pageObject.Click();
          }else{
                Log.Error("Object not exists on the screen");
          }
          //Or you can use the CheckProperty which is in-build function
          https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqobject/checkproperty.html      
    }