Tag: webdriver

从WebDriverJS确定会话ID

我试图在浏览器上运行WebDriverJS,但是文档在如何控制主机浏览器方面有些模糊。 在这里,它说: 启动一个浏览器来对另一个浏览器运行一个WebDrivertesting是多余的(与简单地使用节点相比)。 相反,在浏览器中使用WebDriverJS旨在自动执行实际运行脚本的浏览器。 只要服务器的URL和浏览器的会话ID是已知的,就可以完成。 尽pipe这些值可能会直接传递给构build器,但也可以使用wdurl和wdsid“环境variables”来定义这些值,这些variables是从加载页面的URL查询数据中parsing出来的: <!– Assuming HTML URL is /test.html?wdurl=http://localhost:4444/wd/hub&wdsid=foo1234 –> <!DOCTYPE html> <script src="webdriver.js"></script> <input id="input" type="text"/> <script> // Attaches to the server and session controlling this browser. var driver = new webdriver.Builder().build(); var input = driver.findElement(webdriver.By.tagName('input')); input.sendKeys('foo bar baz').then(function() { assertEquals('foo bar baz', document.getElementById('input').value); }); </script> 我想从Node.js打开我的testing页面,然后运行包含在客户端脚本中的命令。 但是,我不知道如何能够提取会话ID(wdsid查询参数),当我build立会议。 有人有什么主意吗?

什么将解决WebDriverError:连接拒绝错误信息?

我不能在本地运行量angular器testing,前几天我可以,但现在我不能。 我什至重新启动Ubuntu。 这是我的版本: $cat /etc/issue Ubuntu 14.04.5 $node –version v6.8.0 $npm list -g|grep protractor └─┬ protractor@4.0.9 $webdriver-manager status [13:49:58] I/status – selenium standalone version available: 2.53.1 [default] [13:49:58] I/status – chromedriver version available: 2.22 [default] [13:49:58] I/status – android-sdk is not present [13:49:58] I/status – appium is not present $/opt/google/chrome/chrome –version Google Chrome 54.0.2840.59 unknown […]

Node.js + mocha + webdriverjs:失败的testingkill套件

我正在使用Mocha和WebDriverJStesting一个Web应用程序,或多或less地在这里描述 。 当testing通过,一切都很好。 但是,如果一个testing失败,套件中的其余testing将超时,跑步者将在套件结束时退出,而不closuresWebdriver实例。 示例testing用例: var assert = require('assert'), client = require("webdriverjs").remote({ logLevel: 'silent' }); describe('Self-test', function() { before(function(done) { client .init() .url('http://www.wikipedia.org/', function() { done(); }); }); after(function(done) { client.end(function() { done(); }); }); // tests it('should fail properly', function(done) { client.getTitle(function(result) { assert(false, 'This should fail'); done(); }); }); it('should pass afterwards', function(done) […]