Forum Discussion

userdanfoss's avatar
userdanfoss
Occasional Contributor
4 years ago
Solved

Findchildbyxpath in testcomplete

I am trying to click on the object which appears when we do mouse hover.

But i am not able to click on it.

Testcomplete fails to capture the unique object with recording so i am using xpath .

please see below eg.

NameMapping.Sys.browser.pagePlus1Connect3.panelRoot.panel.panel.panel.panel.panel.panel.panel.panel.HoverMouse();
let widconfig = page.FindChildByXPath("//span[@title='Widget configuration']",true);

obj.Click();

 

Now here widconfig.Click() is not allowed. I am getting the error

 

 

5 Replies

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      userdanfoss :

       


      BenoitB wrote:

      That means the standard Click is not implemented but a custom click.

      Try  .click()  instead of .Click()


      A little bit more about this:

      .Click() is a method that TestComplete adds to all recognized web elements.

      As it is documented, if TestComplete can match web element found via .FindChildByXPath() to the element in the Object Tree, then the found element will be wrapped and will contain all properties and methods that TestComplete adds to the tested objects.

      If the match fails, then plain DOM object will be returned as a result of .FindChildByXPath() search. In this case the returned object will contain only native properties/methods provided by DOM. .click() is a native method and must be used in this case.

       

      • BenoitB's avatar
        BenoitB
        Community Hero

        Yes i not always details of the hint i give .....  because i'm confident on other mates to do it ! 

        Txs Alex 😉