Forum Discussion

kruttika's avatar
kruttika
Occasional Contributor
9 years ago

Unable to find the object Confirm.

Unable to find the object Confirm.
Case Description:I am using the Confirm object used for confirmation messages. I want to Click on the OK Button, but it give me an error as "Unable to find the object Confirm. See Additional Information for details."

The example for the click confirmation message in Test complete documentation works fine on IExplorer and Firefox but not on chrome. Need an urgent help as its blocking the further processes.

the piece of code used is as follows

var Page=Sys.Browser("*").Page("*");
var Travel_Cost_Input = Page.QuerySelector('#service_cost_input');
Travel_Cost_Input.Click();
Page.Wait();
Page.Confirm.Button("OK").Click();
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3

    Hi,

     

    Another possible reason is that page is not reloaded after Travel_Cost_Input.Click() command and thus Page.Wait returns immediately and before the confirmation message appears.

    If the confirmation message must appear at this moment, I would recommend to replace

    Page.Confirm.Button("OK").Click()

    with

    Page.WaitConfirm(2000).Button("OK").Click()

     

    • kruttika's avatar
      kruttika
      Occasional Contributor

       tried using that too.. but it doesnt work. It just says "Waiting for Confirm()". Also the Chrome extension is already installed.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        What does your object inspector show for that Confirm object in TestComplete? I mean, you're calling it as Page.Confirm... under Chrome, does TestComplete see it as something different?  Could you post a screenshot of your object browser or object spy so we can see what you see?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Probably a dumb question... but do you have the Chrome Extension/Plugin for TC installed? If not, I think you'll find many errors when working with Chrome.