Ask a Question

The object does not support this property or method

nwalimbe
Occasional Contributor

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 3
baxatob
Community Hero

Re: The object does not support this property or method

Hi,

 

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

nwalimbe
Occasional Contributor

Re: The object does not support this property or method

page = Sys.Browser("*").Page("*")

tristaanogre
Community Hero

Re: The object does not support this property or method

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: