Only Selenium can test it? What? Surely not this simple page

When you look at a conference program, the session abstracts are naturally a kind of publicity to motivate people to attend and should be considered as such. Nervertheless an abstract shouldn’t exagerate too much to stay credible.

“… including applications that only Selenium can test”. Where?

In Neal Ford’s numerous sessions about Selenium, you will see again and again that he will present “testing Ajax applications (including applications that only Selenium can test)” (see for instance in
Advanced Selenium (No Fluff Just Stuff)
). When you write such a provocative statement, you have to prove it. I’ve attended one of his presentations (it was really poor, see previous post here) but I haven’t seen anything that would cause trouble to all existing web testing tools except to Selenium.

But very simple pages can’t be tested with Selenium

On the other side a page as simple as this example

<html>
<head>
<script>
document.getElementById = function(_id)
{
return {id: _id, nodeType: 3, data: 'he he, you failed!'};
}
</script>
</head>
<body id='bodyId'>
this is a very simple page
</body>
</html>

will currently cause enorm problems to Selenium that won’t even be able to execute correctly a simple
verifyText id=bodyId this is a very simple page

The reason? Selenium uses the DOM functions to work on the html document and therefore relies on them.

Ok, this point isn’t a very big limitation as changing the functionality of the DOM functions is not a common need. In fact this post was just to say that I wait to see a web application that “only Selenium can test” but that even a very small page can cause problems to Selenium whereas it is handled correctly by most of the other web testing tools.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: