Forum Discussion

nwalimbe's avatar
nwalimbe
Occasional Contributor
7 years ago

The object does not support this property or method

 am a newbie and trying to recognize objects using xpath as nothing else is working.

So the issue is when I try to select xpath for a calendar icon, it is unable to find the exact object and on using 'click' method, gives above error. Pls. help resolving this. Screenshots attached:

 

Code being used:

obj = page.FindChildByXPath('//*[@id="TransitStartTime_LocalDate"]/span/i', True)
  if (GetVarType(obj) != varNull):
    # If the element was found, click it
    obj.Click()
  else:
    # If the element was not found, post a message to the log
    Log.Message('The element was not found.')

 

Error received is:

Python runtime error. AttributeError: The object does not support this property or method. Error location: Unit:


AttributeError: The object does not support this property or method.
 
Firefox and Chrome returns xpath as:
//*[@id="TransitStartTime_LocalDate"]/span/i

 

Pls. help.

3 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Check carefully what object is assigned to page variable. It should be the Page.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      What line is generating the error? 

      Basically, as has been mentioned several times around here, XPath searches may not return a TestComplete "On Screen" object which means the TestComplete method of "Click" might not be available.