Archive for the 'Selenium' Category

Recommendations for Learning JavaScript and CSS Selectors

I’ve been programming more JavaScript recently. This helps my testing in a number of ways: When testing web sites I can understand the client side code I can nudge the client side into different states by executing ad-hoc JavaScript through the console The DOM web developer displays make ever more sense It also helps my [...]

Selenium 2.0rc2 – Hey, where’s my unashamedly ugly wait

Warning, this blog post contains Java code. Some testers may want to look away now. I was quite happy using the unashamedly ugly Selenium Wait class, for adhoc waits that I did not want to refactor into proper classes. e.g.         new Wait("JS Page title did not change"){             @Override             public boolean until() { [...]

How can I learn to automate my testing using Selenium?

In this blog post, I’m going to lay out the Evil Tester free and simple 8 step guide to learning how to automate a Web Browser using Selenium. I’ll reveal the sources of information you can use. And yes, I will promote my book. music by Drongomala @ flyingmountainrecords.com I see the same questions, and [...]

When automating, do you wait before or after the event?

As I worked on the code for my “migrating to selenium 2.0” workshop at Tony Bruce’s Skills Matter event recently. One of my automation challenges involved waiting for an element to have clickability. It existed in the DOM, visible, and all other rendered event style isCondition()s. But when clicked on, it could not respond to [...]

Selenium 2 makes automation debugging easier

One of the parts of Selenium 1.0 that I never enjoyed was debugging automation that didn’t work. I had to faff about creating custom Firefox profiles with Firebug installed and set to go through a proxy. Selenium 2 makes all of that so much easier. With the code below, my test runs through a proxy [...]

So now you have a choice of Selenium Testing books and ebooks

Both my and David Burns’ books are now available on amazon: Mine: Selenium Simplified   [amazon.com] [amazon.co.uk] published by Compendium Developments David’s: Selenium 1.0 Testing Tools   [amazon.com] [amazon.co.uk] published by Packt

Using JUnit Nested Suites with Selenium RC to simulate TestNG suite and grouping annotations

When I use TestNG for my Selenium tests, I really like the BeforeSuite and AfterSuite annotations because then I can share a Selenium session amongst the tests. With nested JUnit suites I can achieve a similar effect, and I can also go some way to grouping my tests to make it easier to create browser [...]

What if Selenium’s Highlight Command was always on?

A reader asked for recommendations on how to use Selenium’s "Highlight" command. Now I personally don’t use the highlight function. Never really have. When I debug my tests, I step through the script in Eclipse (I write all my tests in Selenium-RC using Java). But, by using reflection to automatically generate code for a java [...]

Selenium Example – How to Amend the JavaScript of the Web Application Under Test

Why would you want to change the JavaScript of a web application you have to test? Well, if you want to test that events get triggered correctly and the basic structure of the page rather than the actual functionality implemented by the JavaScript. Perhaps the JavaScript does something that you can’t handle with the automation [...]

A simple getCSSCount for use with Selenium-RC

We know that XPath runs slowly in IE, but XPath has the getXPathCount method. And CSS runs quickly but Selenium doesn’t have a corresponding getCSSCount method. I looked around for a simple way of getting count from a CSS selector. I found this blog post by Aditya Ivaturi, but since I like to keep my [...]