JeanL
16 years agoContributor
Item.Exists => Object does not support this property or method
Hello,
how come this piece of code isn't working?
Dim page
Dim button
Set page = GetPage("http://www.my_example.com")
Set button = page.Form("aspnetForm").Item("btn_cancel")
If button.Exists Then button.Click
page.Wait()
When execution of the script reaches to If-condition TestComplete 8 gives VBScript runtime-error and says "Object does not support this property or method". However, Support portals article about Item Method (Web Objects) states that "If the specified element does not exist, the method returns a stub
object. To determine whether the method returns an existing element,
check the
In above code example the button.Click works without the If-statement.
how come this piece of code isn't working?
Dim page
Dim button
Set page = GetPage("http://www.my_example.com")
Set button = page.Form("aspnetForm").Item("btn_cancel")
If button.Exists Then button.Click
page.Wait()
When execution of the script reaches to If-condition TestComplete 8 gives VBScript runtime-error and says "Object does not support this property or method". However, Support portals article about Item Method (Web Objects) states that "If the specified element does not exist, the method returns a stub
object. To determine whether the method returns an existing element,
check the
Exists property of the returned object". But in this case Exists property causes error.In above code example the button.Click works without the If-statement.