So im pretty used to Automated integration testing on Rails, however i've been trying to move into learning Node.js and getting used to writing integration tests on that.

Im used to using Capybara, so I don't know the bindings for node. Im assuming i'd use the JS one's...however it's a lot more confusing than Capybara as im a bit lost in reading the API.

for example: I see in the API calls for "Webdriver" such as this.findElement( locator ) but also ones for Chrome/PhantomJS. So maybe the issue is...im not sure what Selenium exactly "IS". When using Capybara (for rails) I used the Poltergeist (Which uses PhantomJS) driver.....so in that case Capybara was just serving as a DSL for the PhantomJS driver right? or was it binding to WebDriver.

I think im getting all of the "Drivers" confused. Can anyone explain them? Capybara was very straightforward, but I can't stay in rails land forever.


I would recommend you study Selenium javascript http://seleniumhq.github.io/selenium/docs/api/javascript/index.html and also read up on node.js https://nodejs.org/en/docs/ which is utilized. This is straight code and not a utility or encapsulated framework layer. You would need to build one yourself or integrate with an existing one.

Selenium is a code library, so something like Capybara integrates the selenium library into a framework to utilize. I usually like building mine from scratch to customize for each project, but the principals are the same. Look into the core of selenium and then into how nodejs. You can also look into adapting other frameworks for usage with node.js&Selenium as well, but would likely have to customize a bit unless one is already setup to integrate.

In general you will see in reading the code that the framework classes extend and utilize the Selenium classes in the library. Each one has it's on uniqueness though, so I recommend starting at the base of Selenium & node.js and then figure out what framework you want to extend or encapsulate it with. Good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.