TestComplete doesn't show click method on inspection but it will appear in browser
Hi, I am currently having issues attempting to click a icon button within my application. TestComplete is able to find the element through the FindChildByXPath method however, when TestComplete attempts to click the button I recivev an error saying "Click is not a function".
Through further investigation within the Chrome inspect element "Click" is listed as an event listener. But in TestComplete this method does not appear. Is therre anyway to work around this issue?
Thank you for any help!
note: Some title and class names have been changed for the examples. Within the screenshot for the methods shown by TestComplete the remainder of the list that cannot be seen also does not show a Click method.
Solved! Go to Solution.
The object is a <span> and not a <button>, hence Click() method won't work. Try getting the parent object, and see if Click() method works.
Hi @rraghvani thank you for the reply. Unfortunately that button when clicked is just to produce the dropdown menu to see the further nodes. The <span> element which is the "plus" icon on the browser is what im trying to click to show a further dropdown menu. However that is the only element used to show that further dropdown menu, if you remove that <span> you can no longer access or click anywhere to get that next dropdown menu.
I've found an example website that uses <span> on a tree view. The following coding is able to click on Beverages and expand the nodes.
I suggest you try to perform a click on "Node 1" text
Hi @rraghvani, unfortunately I have already tried clicking on the "Node 1" text, but it is not clickable. Only the <span> containing the "plus" icon is clickable.
What does the HTML coding look like? For example,
The code is on the lines of this:
//This is the element that needs to be clicked
//This is the element containing the "Node 1" text
So the first <span> is what needs to be clicked, if you remove this span the dropdown menu can no longer be accessed anymore.
I mean the full HTML, including these items
It's not possible to click on a <span> unless it has text
The full HTML is:
<span class="treeToggle glyphicon glyphicon-minus-sign">::before</span>
<li> title="node 1">
<ul>for the dropdown list items .....</ul>
The span with the class "glyphicon-minux-sign" is just used to collapse the tree.
It won't be possible to select the item.
Not sure why you have empty <span><span>. You need to speak to speak with your developers to resolve this.