title: CasperJS click() cannot dispatch mousedown event error
body: <p>I'm using CasperJS 1.1 and I want to simulate clicking on a file field, but I'm getting an error when I run the test (the project is using AngularJS fwiw):</p>
  
  <pre><code># Create gallery page
  PASS File field exists
  FAIL Cannot dispatch mousedown event on nonexistent selector: input#gallery_file_0
  #    type: uncaughtError
  #    file: spec/javascripts/casperjs/create_gallery.coffee:1323
  #    error: Cannot dispatch mousedown event on nonexistent selector: input#gallery_file_0
  #           CasperError: Cannot dispatch mousedown event on nonexistent selector: input#gallery_file_0
  #               at mouseEvent (/usr/local/Cellar/casperjs/1/libexec/modules/casper.js:1323)
  #               at click (/usr/local/Cellar/casperjs/1/libexec/modules/casper.js:428)
  #               at spec/javascripts/casperjs/create_gallery.coffee:7
  #               at runStep (/usr/local/Cellar/casperjs/1/libexec/modules/casper.js:1523)
  #               at checkStep (/usr/local/Cellar/casperjs/1/libexec/modules/casper.js:368)
  #    stack: not provided
  </code></pre>
  
  <p>The error doesn't make sense to me, because my previous assertion that the input field exists is actually true. Here is the test file:</p>
  
  <pre><code>casper.test.begin "Create gallery page", 1, (test) -&gt;
  
    casper.start "http://localhost:3000/galleries/new", -&gt;
  
      @then -&gt;
        test.assertField("input#gallery_file_0", null, "File field exists")
        @click("input#gallery_file_0")
  
  
    casper.run()
  </code></pre>
  
  <p>What might be the problem?</p>
  
  <p>Versions:</p>
  
  <pre><code>casperjs --version
  1.1.0-DEV
  
  phantomjs -v
  1.9.1
  
  MacOSX 10.8.4
  </code></pre>