webdriverjs: Expected string got an object <p>After discovering Mocha and webdriverjs, I wanted to give it a shot, after reading the <code>readme.md</code> in <a href="https://github.com/camme/webdriverjs" rel="nofollow">https://github.com/camme/webdriverjs</a>, so i began with a trivial test.</p> <pre><code>var webdriverjs = require("webdriverjs"), client = webdriverjs.remote(), expect = require("chai").expect; suite('Functional tests', function(done) { setup(function(done) { client.init().url('http://www.google.com', done); }); test('test if you can open a firefox page', function() { var inputType = client.getAttribute('#searchtext_home', 'type'); expect(inputType).to.be.a('string'); console.log(myString); }); teardown(function(done) { client.end(done); //done(); }); }); </code></pre> <p>Get the input element of google and expect its type is text. I end up with an object in <code>inputType</code> variable.</p> <p>AssertionError: expected { Object (sessionId, desiredCapabilities, ...) } to be a string</p>