Forum Discussion

yabing's avatar
yabing
Occasional Contributor
8 years ago
Solved

Javascript PageObj.Confirm.Button("OK").Click() get Error "PageObj.Confirm.Button is not a function"

Hi,   I'm writing a javascript testing for a web UI against IE10 by using TestComplete 12. I want to click a confirm pop up window, but got "PageObj.Confirm.Button is not a function".   I use a f...
  • yabing's avatar
    8 years ago

    Hi,

     

    I found that this function is not correct on SmartBear support document. It should be PageObj.Confirm().Button("OK").Click().

    We need a bracke after "Confirm".

     

     

    Thank you for your helps,

    Yabing

  • tristaanogre's avatar
    tristaanogre
    8 years ago

    That's what was hinted at above... "Confirm" is a method on any web page that returns the Confirm object for that page.  So, if you are calling it, you need to add the brackets as you noted.

    HOWEVER, if you mapped the object using NameMapping/Aliases to specifically look for the Confirm object, then it is an object, not a method, and you don't need the brackets.

    The examples in the documentation probably do need a bit of a correction, but only to indicate that the confirm object in the examples has been mapped via NameMapping.