node.js - Running WebdriverJS test on Selenium Grid -
i have selenium grid running on amazonec2
it consists of hub running on port 7055 , node running on port 7056.
i have following test:
var webdriver = require('selenium-webdriver'), driver = new webdriver.builder(). usingserver('http://ec2-50-18-75-182.us-west-1.compute.amazonaws.com:7055/wd/hub'). withcapabilities({'browsername': 'firefox'}). build(); var posttitle = "post "+(+new date); driver.get('http://si-demo.herokuapp.com/posts/new'); driver.findelement(webdriver.by.id('post_name')).sendkeys("selenium"); driver.findelement(webdriver.by.id('post_title')).sendkeys(posttitle); driver.findelement(webdriver.by.id('post_content')).sendkeys("this auto generated test"); driver.findelement(webdriver.by.name('commit')).click(); driver.quit(); that fails when try connect hub port. test run when connect directly node port.
the error when connecting grid hub is:
timers.js:103 if (!process.listeners('uncaughtexception').length) throw e; ^ error: etimedout connect etimedout @ clientrequest.sendrequest (/users/jason/development/cirrus/spanish-inquisition-runner/node_modules/selenium-webdriver/http/index.js:127:16) @ clientrequest.eventemitter.emit (events.js:96:17) @ socket.socketerrorlistener (http.js:1436:9) @ socket.eventemitter.emit (events.js:96:17) @ socket._destroy.self.erroremitted (net.js:329:14) @ process.startup.processnexttick.process._tickcallback (node.js:244:9) ==== async task ==== webdriver.createsession() @ function.webdriver.webdriver.acquiresession_ (/users/jason/development/cirrus/spanish-inquisition-runner/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:130:49) @ function.webdriver.webdriver.createsession (/users/jason/development/cirrus/spanish-inquisition-runner/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:109:30) @ builder.build (/users/jason/development/cirrus/spanish-inquisition-runner/node_modules/selenium-webdriver/builder.js:70:22) @ object.<anonymous> (/users/jason/development/cirrus/spanish-inquisition-runner/open_canvas.js:5:8) @ module._compile (module.js:449:26) @ object.module._extensions..js (module.js:467:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.runmain (module.js:492:10) my question is: selenium webdriverjs support connecting hub? if doing wrong?
notes:
- i have connected hub , run same steps rspec test.
- i able connect hub locally on ec2 instance , run test, happens when trying connect remotely grid.
- when looking @ selenium2 grid console @ :7055/grid/console appear using session on node.
commands used on ec2 start grid:
xvfb :0 -screen 0 1024x768x24 2>&1 >/dev/null & export display=:0 java -jar selenium-server-standalone-2.32.0.jar -port 7055 -role hub xvfb-run java -jar selenium-server-standalone-2.32.0.jar -role node -hub http://localhost:7055/grid/register
have tried using remote webdriver? haven't usethe js driver, c# has specific driver remote grid connections.
https://code.google.com/p/selenium/wiki/webdriverjs#using_the_stand-alone_selenium_server
looking @ js docs, need when construct driver:
var webdriver = require('selenium-webdriver'), seleniumserver = require('selenium-webdriver/remote').seleniumserver;
Comments
Post a Comment