n1k0/casperjs — Issue #37: TypeError Undefined on remote with mouseClick()
Author: leplatrem
Created: 2012-01-10 13:57:54+00:00
State: open

Those are my first steps with casperjs, trying to find a good jquery-mobile navigation testing tool.

I setup Casper with verbose debug output (hate silence), and want to perform a mouse click (in my case, slightly different from form submitting)

```javascript
var BASE_URL = 'http://127.0.0.1:8000/mobile/';

var casper = new phantom.Casper({
verbose: true,
logLevel: "debug",
});

casper.start(BASE_URL, function(self) {
self.test.assertExists('h1.ui-title', 'screen title loaded');
self.test.assertEvalEquals(function() {
return $('h1.ui-title').html();
}, 'Welcome', 'screen title');

self.test.assertExists('a[id=submit-login]', 'connection button');
self.mouseClick('a[id=submit-login]');
});

casper.run(function(self) {
self.test.renderResults(true);
});

```

I get a ``TypeError: 'undefined' `` error and the click is not performed.

```
[info] [phantom] Starting...
[info] [phantom] Running suite: 2 steps
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step 2/2 http://127.0.0.1:8000/mobile/ (HTTP 200)
PASS screen title loaded
PASS screen title
PASS connection button
[error] [phantom] Step error: TypeError: 'undefined' is not a function
[info] [phantom] Step 2/2: done in 506ms.
[info] [phantom] Done 2 steps in 752ms.
PASS 3 tests executed, 3 passed, 0 failed.
```