Tag: 谷铬

在设置Selenium + NodeJS时运行testingJS脚本时出错

我主要是按照这个指南在运行Ubuntu 14.04的Vagrant中设置Selenium + Node + Chrome。 Running Headless Selenium with Chrome 当我运行第6步中的确切示例时,NodeJS返回错误,而不是返回步骤7中显示的结果。 由NodeJS给出的错误: vagrant@dev:/pm/setup/install/chrome$ node test.js /pm/setup/install/chrome/node_modules/selenium-webdriver/lib/goog/async/nexttick.js:39 goog.global.setTimeout(function() { throw exception; }, 0); ^ UnknownError: unknown error: unable to discover open pages (Driver info: chromedriver=2.2,platform=Linux 3.13.0-44-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 20.67 seconds Build info: version: […]

ChromeOptions使用Selenium ChromeDriver for node.js导致引用错误

我正在尝试使用Chrome的ChromeDriver驱动程序来运行一些使用Chrome的testing,但是当我使用ChromeOptions时候出现了一个引用错误。 我的代码 我想强制使用某些选项,例如针对特定的用户configuration文件进行testing。 基于Selenium和ChromeDriver文档,这是我的文件test.js : opt = new chromeOptions(); // ERROR OCCURS HERE! opt.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); opt.addArguments("–user-data-dir=C:\\Users\\MyUserAccount\\AppData\\Local\\Google\\Chrome\\User Data"); driver = new ChromeDriver(opt); // rest of my script goes here 错误 我使用命令node test.js执行此操作。 这将在第一行中引发以下错误: \path\to\test.js:1 ction (exports, require, module, __filename, __dirname) { opt = new chromeOpti ^ ReferenceError: chromeOptions is not defined at Object.<anonymous> (\path\to\test.js:1:73) at […]

selenium/ WebdriverIO Chrome无头?

使用Chrome在无头模式下使用Selenium / WebdriverIO进行自动浏览器testing有可能吗? 据说铬 – 无头是现在的事情,但我无法得到他们的例子工作。 我希望Selenium有这个select吗? 我正在初始化WebdriverIO像这样: const WebdriverIO = require('webdriverio'); let driver = WebdriverIO.remote({ desiredCapabilities: { browserName: browser, // "chrome" or "firefox" }, }); 我开始使用selenium独立selenium : selenium-standalone start > /dev/null 2>&1