title: Javascript button click not working in selenium webdriver
body: <p>I am trying to automate hitting a javscript button using a python script and web driver however no matter how I try to refer to the element it doesn't seem to activate the javscript. Here's an excerpt from the website I am trying to hit the button on:</p>
  
  <pre><code>&lt;li&gt;
  &lt;a href="javascript:;" data-blogid="19079" id="picture-trigger"&gt;
  &lt;i class="glyphicon glyphicon-picture light-red"&gt;&lt;/i &gt;
  &lt;span&gt; Picture &lt;/span &gt;
  &lt;/a &gt;
  &lt;/li &gt;
  </code></pre>
  
  <p>I've tried selecting by CSS selector, by XPATH and while I see the element being selected (doted line around it when running), nothing happens. </p>
  
  <p>I've also tried both .click() and .submit() neither one seems to work. Here's my most recent attempt:</p>
  
  <pre><code>element = mydriver.find_element_by_id("picture-trigger")
  element.click()
  </code></pre>
  
  <p>I think perhaps the issue is the javascript:; isn't being triggered when called from web driver the same way it is when an interactive user hits it but I'm at a loss for how else to automate clicking it. </p>
  
  <p>Does anyone with more web driver experience know why this isn't working or how I can get this working?</p>
  
  <p>Thanks
  Brad</p>
  
  <p>Here's what I see when I run the code:
  <a href="https://i.stack.imgur.com/g4cHs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g4cHs.png" alt="Selected Element"></a></p>
  
  <p>Here's what it looks like when I manually click on the button:</p>
  
  <p><a href="https://i.stack.imgur.com/gGXpn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gGXpn.png" alt="enter image description here"></a></p>