Not able to click or Expand the + image button in python selenium webdriver

I'm trying to expand the + button to expand the option under it but unable to expand and python IDE throws below error. Tried different CSS and Xpaths but no luck :(

Error message:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath",

Firefox XPath:


html code below:

<table cellspacing="0" cellpadding="0" style="border-width:0;">
                    <a id="ExcentiveTreeViewn0" href="javascript:TreeView_PopulateNode(ExcentiveTreeView_Data,0,document.getElementById('ExcentiveTreeViewn0'),document.getElementById('ExcentiveTreeViewt0'),null,'r','<span class=\'nodeCss\' onclick=\"LoadPage(\'grids%252fgrid_folders.aspx%253fid_node%253dTzlq3UXxbAE%253d%2526id_table%253d-301%2526id_mod%253dTzlq3UXxbAE%253d\', \'iGrid\');\"><img class=\'nodeIcon\' src=\"../style/-1/treeview/picto_folder.gif\" /><span class=\'nodeText\'>Rules</span></span>','-300#-301#0#staticNode#0#culture#F','f','','f')">
                        <img style="border-width:0;" alt="Develop" src="../style/-1/treeview/rplus.gif"/>
                <td class="" style="white-space:nowrap;" onmouseout="TreeView_UnhoverNode(this)" onmouseover="TreeView_HoverNode(ExcentiveTreeView_Data, this)">

1 answer

  • answered 2018-03-13 20:42 MivaScott

    Don't start the xpath with a period


    Other options:

    1. The code is inside an iFrame so you would need to switch to it first.
    2. The javascript in the href is confusing the selenium parser. There is a lot of HTML code embedded in there.

    Please edit the question to include the code you are trying along with a larger section of the HTML