5 ms·
Everyone in the blogosphere (and at my own company) writing non-app-specific layers on top of selenium suggests that there is scope for a higher level framework
by novocaine 11y ago
Everyone in the blogosphere (and at my own company) writing non-app-specific layers on top of selenium suggests that there is scope for a higher level framework that can be used on top of selenium. Or that the selenium api is too thin a layer over webdriver.
Does anyone know of such a project?
- sry_not4sale 11y agoHave you looked into BDD tools like Behat/Behave/Cucumber ?
- crdoconnor 11y agoI did the exact opposite. I ripped out some robot framework tests and replaced the code with python using selenium webdriver. Works great.
- shicky 11y agocan I ask why you decided to do this? The tests were just flakey while in robot framework world?
- crdoconnor 11y agoI absolutely hated the robot framework. The DSL was just horrible to use. It had weird, unnecessary syntax quirks and gave you the minimal amount of information if something failed (wouldn't tell you which line number it failed on, for instance). The tests were also flaky as hell but that was more to do with poor environment management. That, admittedly, was also easier to fix in python.
- tommyd 11y agoYou might find Site Prism interesting: https://github.com/natritmeyer/site_prism https://github.com/natritmeyer/site_prism (there are alternatives such as http://watirwebdriver.com/page-objects/ http://watirwebdriver.com/page-objects/ and https://github.com/sensiolabs/BehatPageObjectExtension https://github.com/sensiolabs/BehatPageObjectExtension, but I have no experience with them). It provides a "page object model" implementation on top of Capybara, so you can define a model for each page you want to test, which stores the page's relative URL, and has references to all the elements on the page you care about, and methods for all the interactions you want to do with that page. So for example, you might have a "LoginPage" model, which contains the following: class LoginPage < SitePrism::Page set_url "/login" element :username_input, '.username-input' element :password_input, '.password-input' element :submit, '.submit-button' def login(username, password) load # Load the page URL in the Selenium instance username_input.set(username) # Fill in username password_input.set(password) # Fill in password submit.click # Click submit end end Then whenever you want to login from one of your steps, you can just do: login_page = LoginPage.new login_page.login('whoever', 'what3v3r') I think it's a nice abstraction as it allows more experienced test automation developers to build the page model while less experienced ones can write steps just calling the methods. You still have to pay a lot of attention to things like appropriate use of "wait for element to appear" rather than "sleep", and ensuring tests use isolated data, to get it working reliably, but we've got it working pretty well at my current place. I should write up how we have it set up at some point as we have our own app-specific framework on top of SitePrism which provides some useful abstractions to make it quicker to develop tests.
- mherrmann 11y agoYes!! http://heliumhq.com http://heliumhq.com (commercial; I'm one of the people behind it)
- azernik 11y agoI'm just getting into Play Framework development, and they ship with FluentLenium, which seems to add some a more friendly API and convenience functions. Nothing too fancy, but just looking at the pure-Selenium coffee examples people have posted here shows how dramatic the effect can be. The one downside is that the developers only seem to tag official releases once in a blue moon; despite the github repo being well updated, the last push to Maven was more than half a year ago, and so depends on a rather old version of Selenium.
- noir_lord 11y agoI just write my own layers on top of Selenium (with python) This one is a rough test automation, mostly used for filling in forms etc during development http://kopy.io/LMBKt http://kopy.io/LMBKt (old one but to hand) handy to be able to open, login and fill in a form in a few seconds that by hand would take minutes. I find that way works as the abstraction is only one level removed and I can just throw in methods that relate to that project.