Selenium Simplified - Automated Browser Testing With Selenium WebDriver Made Simple

Aug 21, 2012 - 3 minute read - Selenium Simplified Blog WebDriver

Categorising WebDriver–Navigation, Interrogation, Manipulation

Hands up who uses generalisation in their modelling strategies? Me too! I’ve worked through the WebDriver API in some detail and as part of figuring out a way to replay the API back to people learning WebDriver. I have adopted 3 main classifications: Navigation Interrogation Manipulation My 4th categorisation has resulted in fewer methods: Synchronisation I initially expected to find more in the Synchronisation category, since the strategies around synchronisation often consume a lot of automation time.

Aug 18, 2012 - 2 minute read - Selenium Simplified Blog WebDriver

Advanced User Interactions and the expletive machine

For the life of me, I could not get User Interactions to work properly. They just wouldn’t work. They used to work, last time I tried them. But now… new Actions(driver).keyDown(Keys.CONTROL). sendKeys("b"). keyUp(Keys.CONTROL). perform(); ”!*&^*&£$“, as old comics used to illustrate the expletive. I found I wasn’t alone on the forums. I used a simple user interactions experimental page which had enough to let me see what was happening: key_click_display.html

Aug 17, 2012 - 3 minute read - Selenium Simplified Blog WebDriver

Because sometimes it's hard... some tips for "Working with WebDriver"

"They" should pass a law requiring all titles to utilise alliteration. I can see why people find it hard to work with WebDriver, particularly people new to the tool. Over the years I have learned to expect constant change from the Selenium toolset. After all, the ongoing betterment of web automation worldwide must continue. The API changes. Sometimes it works in this browser sometimes it doesn’t, sometimes a browser upgrade breaks Selenium.

Aug 3, 2012 - 2 minute read - Selenium Simplified Blog WebDriver

A minimal WebDriver based DSL

I read on the Wikipedia entry for Selenium, that Selenium 2.0 aims to provide a base for your own DSL (Domain Specific Language). “What might such a language look like?” I thought to myself. Well, I’ve build DSLs before, but I really thought “What might the minimal DSL that I could create look like?” And so, we proudly present. The FluentWebElement. Yes, all you Seleniumists and Webdriverites, now you too can write:

Aug 3, 2012 - 3 minute read - Selenium Simplified Blog WebDriver

Sporting Event Tribute Using Selenium WebDriver

As I write this, the capital city of England currently hosts a large sporting event. I can mention no names nor dates, for that sequence of words forms part of the protected thou shalt not use list. I don’t even know if ‘they’ will allow me to link to that page. Regardless, I created a small test app which pays tribute to sporting events through the years.   Since I grew up in the 80s, programming on ZX Spectrums, I have a fondness for scrolly text that judders.

Jun 15, 2012 - 1 minute read - Selenium Simplified Selenium Simplified Blog

Second Edition of Selenium Simplified is out

I just noticed that this blog only links to the first edition of Selenium Simplified on amazon. This is particularly tardy and particularly poor marketing since the Second edition has been out for some time. The 2nd edition is a refresh of the 1st edition. It doesn’t really have any new material, but has been updated so that all the old material works with the current versions of Selenium. You can find it on Amazon (these are affiliate links):

Jun 15, 2012 - 2 minute read - Selenium Simplified Blog WebDriver

I never expected ExpectedConditions

I was having a brief trawl through the Selenium codebase and noticed something I hadn’t seen before. An ExpectedConditions class which exposes a bunch of static methods to save me having to write code. And it does save me having to write code. For example in the past I would have written something like this: driver.get("http://compendiumdev.co.uk/selenium/calculate.php"); new WebDriverWait(driver,10). until(new TitleContainsCondition("Selenium")); This opens the driver to the page and waits until the Title contains the text “Selenium”.

Oct 26, 2011 - 1 minute read - Selenium Simplified Blog WebDriver

How to stop firefox 'update failed' dialog messing with your WebDriver automation

There I am, figuring out how to debug my FitNesse automation from within eclipse. And up pops the Firefox ‘update failed dialog’ and interfering with my automation. A bane and a pain when using Selenium RC. But with WebDriver there are easy ways round this. Start firefox with a profile and set the “app.update.silent” firefox property to true. The update error will still happen, but at least firefox won’t try and tell your automated processes about it.

Jul 26, 2011 - 1 minute read - Selenium Simplified Selenium Simplified Blog Selenium-RC

Selenium Simplified Book Source code updated for Selenium 2

I have updated sourcecode for the book to work fully with Selenium 2.1.0 You can download it from here: Source code (InitialSeleniumTests_JUNIT_2ndEdition.zip) Refactored Source code (finalChapterSource_2ndEdition.zip) Yes, the ‘2ndEdition’ on the back of the filename does mean that I am working on an updated version to update it for Selenium 2. Current e-book purchasers can already download a beta of the 2nd edition while I finish updating it, from their re-download page.

Jul 14, 2011 - 2 minute read - Links Selenium Simplified Blog

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 automation; My ability to use the JavaScript calls has improved so I don’t have as much trouble with web sites that don’t play nice My CSS selector skills have improved Clearly for most Selenium automation purposes, we don’t need a large grasp of JavaScript, we mainly do quick DOM access scripts, the kind of thing you would do through the console for debugging.