3

In our QA team, we run a suite of automated tests on every commit the developers do. Since there are quite a few such commits daily and no developer wants to wait more than a few minutes to get feedback we're limited to 5 minutes of testing. In these 5 minutes we want to run as many tests as possible.

We've found that selenium tests are the best for our needs: mostly because they're reliable. If a selenium test reports a JS error you're 95% sure it's a real error. (This is an extremely important property as we've learned from our experience using HTMLUnit). However, running selenium tests is slow and heavy. (We maintain a small cpu farm so we can run many selenium servers and many scripts asynchronously).

Recently we've proposed a new approach - use selenium only for the places where you REALLY need it: popups, ajax, JS in general,.. In other places use a "Textual Browser". For example, if you want to check that the following link "works":

<a href='/somewhere'> link </a>

You don't really need selenium. You can perform a GET request to the page and then use regex/parse the page and use xpath/.. Bottom line - you don't need a JS engine. Clearly this is a much lighter and faster test.

We've had much success with this approach and we ran into the following links:

<a href='/somewhere-1' onclick="foo()" > link 1 </a>
<a href='/somewhere-2' onclick="foo()" > link 2 </a>
... many more such links ...

So in this case, you don't really have to run a selenium script that pressed each and every link. Just click on one of them using selenium (so you test the functionality of the JS function foo()) and then use the textual browser to verify the hrefs of the other links.

My question is where do you think we should draw the line? and I'd be happy to hear your opinions - are there "Textual Browser" tools out there (we haven't worked with WebDriver)?

Guy
  • 12,478
  • 25
  • 61
  • 86

1 Answers1

1

It sounds to me like the line between what you are doing and what I would expect your developers to be doing is a little blurred.

In my mind the developers should be doing unit tests of thier foo() function. TDD in Javascript is a bit low on the tool support, but something that should happen.

If the functions are being unit tests, then selenium becomes the place to test more against the user requirements rather than at the unit of code level.

That said, interactions between QA and Dev teams are pretty complicated socially and it may be hard to get agreement to follow this approach.

Community
  • 1
  • 1
Nat
  • 13,812
  • 5
  • 38
  • 64