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 href
s 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)?