vendredi 2 février 2018

Selenium - Unable to click on element c#

I have a test that clicks on all the node elements of a tree and verifies the title of the new page. I can get it to click on every single element except one. The element exists and I can click on it with my mouse, but I can't get the test to click on it, and it doesn't fail out. Any help would be greatly appreciated!

The part of the test that's having problems (used an element I don't have problems with to verify hovering function worked properly):

IWebElement othernode = IWebDriverExtensions.FindElement(By.Id("node122")); // another element, this one functions properly
HandleMouseHoverEvent(othernode); // hover over functioning element - this is successful
IWebDriverExtensions.wait();

IWebElement findme = IWebDriverExtensions.FindElement(By.Id("node100015")); // element I want to click on
Console.WriteLine("displayed " + findme.Displayed); // check if wanted element is displayed - returns True
Console.WriteLine(findme.Text); // prints text successfully
HandleMouseHoverEvent(findme); // hover over the element I want to click on - this doesn't work, but does not error
IWebDriverExtensions.wait();
findme.Click(); // click on the element I want to click on - this doesn't work, but does not error
Console.WriteLine("clicked"); // this gets printed

Output:

displayed True
New Prospect & Assignment
clicked

Here are the two elements (node122 works, node100015 does not):

<tr nodetype="child" nodesequence="122">
    <td></td>
    <td colspan="2"><span>&nbsp;&nbsp;</span><span id="node122" onclick="try{UpdateNodes(event, this, 'RedirectTab','Interest/Project','action.aspx?treestate=-14-&amp;PageId=50&amp;AppId=10&amp;idnumber=000&amp;AppHeaderName=Prospect+Tracking++-+Interest%2fProject&amp;SelectedNodeSequence=122','Default.aspx?treestate=-14-&amp;PageId=50&amp;AppId=10&amp;idnumber=000&amp;AppHeaderName=Prospect+Tracking++-+Interest%2fProject&amp;SelectedNodeSequence=122', 1)} catch(exp){ }" onmouseout="OnNodeMouseOut(event, this, 1)" onmouseover="OnNodeMouseOver(event, this)" class="menuchild" lvl="1">Interest/Project</span><span></span></td>
</tr>
<tr nodetype="child" nodesequence="100015">
    <td></td>
    <td colspan="2"><span>&nbsp;&nbsp;</span><span id="node100015" onclick="try{UpdateNodes(event, this, 'RedirectTab','New Prospect &amp; Assignment','action.aspx?treestate=-14-&amp;PageId=50&amp;AppId=80&amp;idnumber=000&amp;AppHeaderName=Prospect+Tracking++-+New+Prospect+%26+Assignment&amp;SelectedNodeSequence=100015','Default.aspx?treestate=-14-&amp;PageId=50&amp;AppId=80&amp;idnumber=000&amp;AppHeaderName=Prospect+Tracking++-+New+Prospect+%26+Assignment&amp;SelectedNodeSequence=100015', 1)} catch(exp){ }" onmouseout="OnNodeMouseOut(event, this, 1)" onmouseover="OnNodeMouseOver(event, this)" class="menuchild" lvl="1">New Prospect &amp; Assignment</span><span></span></td>
</tr>

Aucun commentaire:

Enregistrer un commentaire