Ask a Question

Findchildbyxpath in testcomplete

SOLVED
userdanfoss
Occasional Contributor

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

userdanfoss_0-1587730172923.png

 

 

5 REPLIES 5
BenoitB
Community Hero

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

Try  .click()  instead of .Click()

 

Or try a low-level click

See here: https://community.smartbear.com/t5/TestComplete-General-Discussions/My-low-level-click-shared-to-all...

 

 

 

Un sourire et ça repart

sonya_m
SmartBear Alumni (Retired)

Benoit, thank you!

 

Hi @userdanfoss! Does it work for you?


Sonya Mihaljova
Community and Education Specialist

@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.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================

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

Txs Alex 😉

 

Un sourire et ça repart

userdanfoss
Occasional Contributor

Yes it works! Thank You

cancel
Showing results for 
Search instead for 
Did you mean: