title: Unable to perform click action in selenium python
body: <p>I'm writing a test script using selenium in python. I have a web-page containing a tree-view object like this:</p>
  
  <p><img src="https://i.stack.imgur.com/zOz6z.jpg" alt="enter image description here"></p>
  
  <p>I want to traverse over the menu to go to the desired directory. Respective HTML code for plus/minus indications is this:</p>
  
  <pre><code>&lt;a onclick="changeTree('tree', 'close.gif', 'open.gif');"&gt;
      &lt;img id="someid" src="open.gif" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>The <code>src</code> attribute of the image can be either <code>open.gif</code> or <code>close.gif</code>.</p>
  
  <p>I can detect weather there is a plus or minus by simply checking the <code>src</code> attribute of the <code>img</code> tag. I can also easily access to the parent tag, <code>a</code>, by using <code>.find_element_by_xpath("..")</code>. </p>
  
  <p>The problem is that I can't perform the click action not on the <code>img</code> nor the <code>a</code> tag. </p>
  
  <p>I'v tried <code>webdriver.Actions(driver).move_to_element(el).click().perform()</code>; but it did not work. </p>
  
  <p>I think I should mention that there is no problem in accessing the elements, since I can print all their attributes; I just can't perform actions on them. Any help?</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>Here's the js code for collapsing and expanding the tree:</p>
  
  <pre><code>function changeTree(tree, image1, image2) {
      if (!isTreeviewLocked(tree)) {
          var image = document.getElementById("treeViewImage" + tree);
          if (image.src.indexOf(image1)!=-1) {
              image.src = image2;
          } else {
              image.src = image1;
          }
  
          if (document.getElementById("treeView" + tree).innerHTML == "") {
              return true;
          } else {
              changeMenu("treeView" + tree);
              return false;
          }
      } else {
          return false;
      }
  }
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I Googled for some hours and I found out that there is a problem about triggering the Javascript events and the click action from web-driver. Additionally I have a <code>span</code> tag in my web-page that has an <code>onclick</code> event and I also have this problem on it.</p>