Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Really Quick Start

You can also use Selenium IDE to create and edit tests:

Overview and Usage Notes

ERSelenium provides several features for effective use of SeleniumCore with WebObjects applications including:

  • Custom setup/teardown actions that can be run before/after each test.
  • Base URL independence.
  • Support of HTML and Selenese test formats (Java support is planned).
  • "On-the-fly" generation of test suites from the files in your project's source tree.
  • Bookmarkable DirectAction url to run all tests (can be used for automated testing).
  • Metacommands (special instructions specified in comments).

SeleniumCore is the powerful javascript toolkit for web applications "black-box" testing. It emulates different kinds of user actions such as: clicking the hyperlink, editing text in the input field, choosing item from the list and so on.

Using ERSelenium

You can use ERSelenium directly from workspace:

...

To run all tests point your browser to SeleniumStartTesting Direct Action:
http://baseurl/wa/SeleniumStartTestingImage Removed

Example:
http://127.0.0.1/cgi-bin/WebObjects/SampleProject.woa/-42421/wa/SeleniumStartTestingImage Removed

To run a specific group of tests, add "/TestGroupName":

Code Block
http://baseurl/wa/SeleniumStartTesting/TestGroupName
http://127.0.0.1/cgi-bin/WebObjects/SampleProject.woa/-42421/wa/SeleniumStartTesting/registration

Some tips for writing tests for ERSelenium

  • Don't use full URLs with open/openWindow commands (http://baseurlImage Removed part will be added by ERSelenium):
    Code Block
      |open|/wa/EditPerson|
      |open|/|
    
  • You can use setup/teardown methods from the class, specified in SeleniumActionsClass property by opening /wa/SeleniumAction/methodName URL, e.g.:
    Code Block
      |open|/wa/SeleniumAction/resetSession|
    
  • You can use @repeat-@values-@done metacommands to execute specific part of the test with additional values edited in textboxes, e.g.:
    Code Block
      @repeat
        ...some actions...
        @values user1 user2 user3
        |type|user|user0|
        @values pass1 pass2 pass3
        |type|password|pass0|
        ...some more actions...
      @done
    
    The commands between @repeat and @done will be repeated several times, each time with new value in "user" and "password" input field. The values are seperated by spaces and if you have multiple @values lines, they all must have the same number of parameters. The @values section applies to the value of the next command.

...