The second in our ‘live coding’ webinars has been released to YouTube.
You can find the embed below.
Slides have been uploaded to SlideShare
Sourcode is under svn with xp-dev: https://xp-dev.com/svn/webdriverwebinars
In the first webinar I create a basic test after investigating the application under test. In the second I refactor this into page objects.
I’m mainly using the webinars to explain concepts and thought processes and a brief summary of what I think I remember I said:
- keep your code and page objects as simple as you can for as long as you can
- just because everyone else adds a login method to the login page, doesn’t mean you have to
- I use page object to model the physical world
- I use other objects to model transactions, workflows and user journeys
- keep navigation separate from page objects to start with
- Refactor to page objects
- Write the test code the way you want it to look
- Write code to call methods that don’t exist and have the IDE create them
I didn’t go into many of the WebDriver API Page Objects very much, since I cover that on my course.
The recommended reading for participants on the webinar was:
I find that when I’m coding for speed for consultancy production projects I use the Slow Loadable Component a lot. I’ve linked to the java docs above, but it also exists in .net as well. The .net API is slightly different than Java but the basic concept is the same. I’ve used both and I find that for speed of construction with minimal synchronisation issues, I use it a lot.
I think I worry about page objects more than other people. And that really deserves its own post. So I’ll quickly summarise what I worry about.
I worry that people don’t think about the page object as an ‘object’ they treat it as a dumping ground for everything to do with interacting with a web application, rather than a clean set of abstractions. Hence why I try to keep things separate and simple for as long as I can.
And the reason I say that? Because I have started complicated before, and have had to unwind code and had to ‘code around’ mistakes I made.
Keep it simple for as long as you can.