I’ve been looking forward to the iPhone 4 ever since the 3GS was released, as I
was in contract at the time and decided to wait another year for whatever Apple
decided to release next. Due to unexpected
(but very cool)
circumstances, I was out of the country on the day Apple released the iPhone 4
and so was unable to queue up for one of the devices, and now due to the demand
it’s very difficult to get hold of one. Since getting back to the UK I have been
visiting my two nearest O2 stores to check if they have had a delivery, and
today they pointed me towards their online stock checker…
So rather than check this manually, I decided to write a couple of small
Selenium 2 scripts to check the stock levels at my ‘local’ stores, and to find
out all stores that do have the devices. These examples use Java with TestNG
(for dataproviders), and Selenium 2.
WebDriverTestBase.java
O2Stock.java
The current output of the findStock method for iPhone 4 is below:
Last update 01 Jul 2010 @ 13:00 - next update due around 17:00
iPhone 4 16GB (Black) is in stock at the following 5 O2 stores:
24 The Cascades, Cascade Centre, PORTSMOUTH, Hampshire, PO1 4RJ
98 Union Street, ABERDEEN, Scotland, AB11 6BD
Unit 3 Bon Accord Centre, George Street, ABERDEEN, Scotland, AB25 1HZ
219 Union Street, ABERDEEN, Scotland, AB11 6BA
26 South Walk, CWMBRAN, Wales, NP44 1PU
Last update 01 Jul 2010 @ 13:00 - next update due around 17:00
iPhone 4 32GB (Black) is in stock at the following 5 O2 stores:
24 The Cascades, Cascade Centre, PORTSMOUTH, Hampshire, PO1 4RJ
98 Union Street, ABERDEEN, Scotland, AB11 6BD
Unit 3 Bon Accord Centre, George Street, ABERDEEN, Scotland, AB25 1HZ
219 Union Street, ABERDEEN, Scotland, AB11 6BA
26 South Walk, CWMBRAN, Wales, NP44 1PU
Have fun!
Update 1: Some changes to the output, also including the datestamp of the
latest update. I have also made this available
from my public svn repository.