【发布时间】:2013-12-23 13:26:42
【问题描述】:
发现 Mocha 和 webdriverjs 后,我想试一试,看了https://github.com/camme/webdriverjs 中的readme.md,于是我开始了一个琐碎的测试。
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();
});
});
获取google的输入元素,期望它的类型是文本。
我最终在inputType 变量中得到了一个对象。
AssertionError: 期望 { Object (sessionId, desiredCapabilities, ...) } 是一个字符串
【问题讨论】:
标签: javascript webdriver webdriver-io