Problem
At my workplace, we are trying to find the best way to create automated tests for an almost fully embedded intranet javascript application. Right now we are stuck trying to find a good compromise between:
- Application code in reusable GUI components nested in a socket.
- Tests that are easily created by the test team
- Tests that can be recorded once and then automatically
- Tests that do not break after minor cosmetic changes on the site
XPath expressions (or other possible expressions, such as the jQuery selector) that are naively generated from the Selenium-IDE are often not repeated and very fragile. Conversely, the presence of JS code generates special unique ID values for each important DOM element on the page ... well, this is its own headache, complicated by reusable GUI components and identifiers that must be consistent, to work.
What success have other people had with such things? How do you perform automated testing of the rich JS interface layer at the application level?
Limitations
- We are using JavascriptMVC 2.0, hopefully 3.0 soon so we can upgrade to jQuery 1.4.x.
- The people involved in testing are mainly trained in using the Selenium IDE to directly account for things.
- - HTML- ...
- (, , HTML ) - -go.
- javascript-, , GUI ( , ) .
- HTML . , ID.
- (, - ) Selenium-IDE.
- , , " " , .
, - ( javascript) Selenium-IDE . , (XPath jQuery) DOM. , , .