【发布时间】:2014-02-11 14:21:41
【问题描述】:
Error: Cannot find module 'selenium-webdriver'
我已经使用 npm install -g protractor webdriver-manager update
var webdriver = require('selenium-webdriver');
describe('modes of failure', function() {
it('should fail to find a non-existent element', function() {
browser.get('index.html#/form');
// Run this statement before the line which fails. If protractor is run
// with the debugger (protractor debug debugging/conf.js), the test
// will pause after loading the webpage but before trying to find the
// element.
browser.debugger();
// This element doesn't exist, so this fails.
var nonExistant = element(by.binding('nopenopenope')).getText();
});
it('should fail to use protractor on a non-Angular site', function() {
browser.get('http://www.google.com');
}, 20000);
it('should fail an assertion', function() {
browser.get('index.html#/form');
var greeting = element(by.binding('{{greeting}}'));
expect(greeting.getText()).toEqual('This is not what it equals');
});
});
【问题讨论】:
-
你为什么要这样要求 webriver?
-
你能试着用这个命令行运行这个例子吗?
protractor node_modules/protractor/example/conf.js
标签: angularjs selenium protractor