background preloader

Selenium

Facebook Twitter

Selenium Tutorial for Beginner/Tips for Experts. Selenium Reference. A command is what tells Selenium what to do. Selenium commands come in three 'flavors': Actions, Accessors and Assertions. Each command call is one line in the test table of the form: Actions are commands that generally manipulate the state of the application. They do things like "click this link" and "select that option". If an Action fails, or has an error, the execution of the current test is stopped. Many Actions can be called with the "AndWait" suffix, e.g. Accessors examine the state of the application and store the results in variables, e.g. Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. All Selenium Assertions can be used in 3 modes: "assert", "verify", and "waitFor". "waitFor" commands wait for some condition to become true (which can be useful for testing Ajax applications).

Element Locators tell Selenium which HTML element a command refers to. Element Locators tell Selenium which HTML element a command refers to. Acceptance testing a grails app with selenium-rc « Schneide Blog. Having extensive acceptance tests is the basis of delivering high quality releases with very few regressions for long time projects.

Acceptance testing a grails app with selenium-rc « Schneide Blog

This is even more true when your environment uses dynamically typed languages and changing requirements. One of our Grails projects is running for several years now and continues to evolve and grow. We are in dire need of more acceptance tests and especially their automated execution. Manual testing is not feasible and our coverage through unit and integration tests is not enough. We have a nice set of Selenium IDE acceptance tests already though.

I want to describe our approach to automated and extensive acceptance testing below: We create the acceptance tests using capture & replay with selenium IDE. The end result is fast creation of acceptance tests and much flexibility setting up the test fixture and maintaining the tests. Like this: Like Loading... Test Design Considerations — Selenium Documentation. Types of Tests What parts of your application should you test?

Test Design Considerations — Selenium Documentation

That depends on aspects of your project: user expectations, time allowed for the project, priorities set by the project manager and so on. Once the project boundaries are defined though, you, the tester, will certainly make many decisions on what to test. We’ve created a few terms here for the purpose of categorizing the types of test you may perform on your web application. These terms are by no means standard, although the concepts we present here are typical for web-application testing. Testing Static Content The simplest type of test, a content test, is a simple test for the existence of a static, non-changing, UI element. Does each page have its expected page title? You may or may not need content tests. Function Tests These would be tests of a specific function within your application, requiring some type of user input, and returning some type of results.

Testing Dynamic Elements Here’s an example. Testing Grails Applications With Selenium Rc. Selenium RC Plugin @ GitHub. Selenium Testing Grails Apps In Continuous Integration Using the grails-selenium-rc Plug-in. November 8th, 2009 By admin In our previous posts we published a Maven-based solution that illustrated how to get Selenium tests running against a Grails application completely from the command line (thus enabling these tests to run in the context of a continuous integration build.) Robert Fletcher has been working on a Grails selenium plug-in that promises to do the same thing as what I previously presented with much less configuration (no maven, ant, cargo required.)

I installed Robert’s plug-in with no problem, and I have also downloaded his code from git ( ), and ran his test project with only minor issues. If you want to check out this plug-in you can go through the documentation linked above. If you want to see something working quickly you can follow my recipe (which I thank Robert for helping me with) which I can confirm works on Windoze (the platform I have chosen to punish myself for sins of a past life.) Clone the git repository at cd to the top level directory of the project. Selenium web application testing system.