我正在尝试使用node.js,mocha.js和selenium web-driver编写自动化测试。我安装了node-inspector。现在我只想让node.js,Selenium和node-inspector一起工作。一旦我完成这个,我将使用摩卡。如果我用selenium运行节点文件,我看到我的代码在浏览器上执行。但是,当我将命令node-debug first_test.js
运行到命令行时。我收到这个错误:
Node Inspector is now available from http://127.0.0.1:8080/debug?port=5858
Debugging `first_test.js`
debugger listening on port 5858
`parseFile()` is deprecated. Use `parseString()` instead.
`parseString()` is deprecated. It's not actually async. Use `parse()` instead.
我的node.js(first_test.js)如下:
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('simple programmer');
debugger;
driver.findElement(webdriver.By.name('btnG')).click();
//driver.quit();