June 30, 2016

Test The-Internet 2.0: Page Factories: Setting up, creating them, and understanding how they work

Let's say we wanted to automated a Login Page such as the one on Dave Haeffner's test site, The-Internet. How would we find the username, password and Login button so we can enter the appropriate text into the appropriate text boxes?


Dave Haeffner's http://the-internet.herokuapp.com/login
Like we did last July, we would make sure that Selenium WebDriver methods such as sendKeys (to enter text) and click (to click on a button) were safely wrapped in a set of common utilities, then call these new methods by selector, such as css or id.

... Or we could just use the PageFactory.


Using it is relatively simple to implement, as shown in the illustration below. Reading the JavaDocs and understanding how it works is much harder.


June 22, 2016

June 15, 2016

Building a Test Framework: With Gradle, everything is Groovy

So far, we've seen how to set up the build dependencies in an automated test framework, using Gradle in both IntelliJ and Eclipse. Gradle is more than just a tool to set up build dependencies between third-party software and the Selenium WebDriver framework.  And with the hands-on learning you get from free courses that Gradle, Google, and Udacity put together, you can learn about how Gradle configures tasks, interacts with the file system, handles logging, works with repositories, and sets up tests.

I am really loving how Jeremy Silver explains things in the Gradle for Android and Java course he created on Udacity! Go here to sign up for the free course.

Although I studied it in college and grad school, I have not spent much day-to-day work as a coder until the past year. I love how he walks us through, step-by-step how to follow along with the Gradle exercises he has written, and how Gradle has been integrated with Groovy, a Domain Specific Language (DSL).


June 12, 2016

Free Udacity Course: Gradle for Android and Java

Want to more about Gradle? Sign up for a free course on Udacity!

Gradle for Android and Java 
https://www.udacity.com/course/gradle-for-android-and-java--ud867

https://www.udacity.com/course/gradle-for-android-and-java--ud867


When putting together an automation framework using Selenium WebDriver and Java, you need a way to store the dependencies. This is so you don't have to end up downloading every single third-party component, piece-by-piece. When I was taking a course in Selenium WebDriver 2 with Java, I was introduced to a tool called Maven to do this for me.

Maven was a pretty simple tool to set up. Gradle, though, is a bit more complex.

We have been using Gradle at my workplace ever since I first started my job as an automation engineer. It never was my job description to set up all the initial dependencies, the reporting and logging, design the build process, or set up the tasks, so Gradle was just another buzzword to me.

Lately, though, the senior members of the team have been using a lot more of its functionality. This is why, all of a sudden, blog posts on Gradle start appearing, such as:

A Free Course in Gradle!


I was referred to a free course on Gradle through Gradle.org and its tutorial section.

The course was put together by Mark Viera, Core Engineer at Gradle, and Jeremy Silver, a Udacity course developer.

June 10, 2016

A Quick Gradle Overview: Setting Dependencies and Running Tests

Since January of this year, our little automation department at work has been trying to re-align itself, getting more in line with what the other software developers are doing -- a fantastic (but scary) learning opportunity for me.

Back in March 2015, I was trying to relearn for loops and foreach loops in Java. By September, though, I was helping build out the automation framework for our Selenium WebDriver browser tests -- See Automate Amazon for a sample. And by January 2016, I thought I was really becoming an experienced developer, independently writing a framework to handle Rest APIs. All the extra work I was putting into learning to code was really paying off.

Now, I feel like I don't know anything!

We are switching from being an "Automation Department" to being a "Software Test Engineering" department, from just running browser tests to testing APIs and performance testing. I find myself experimenting with many languages and tools that are brand new to me... and one of them is the build management tool, Gradle.

Maven and Gradle: Setting Dependencies


As far as I knew, a build management tool was something you set up once at the start of the project to handle the dependencies, installing the tools you needed to create the framework, and then forgot about them.

June 8, 2016

Time Capsule: Ward Cunningham's Wiki Wiki Web

What year is it?

The last think I remember, I came home from work early, and sat down in front of my computer. I decided on browsing Ward Cunningham's Wiki Wiki Web  -- now over twenty years old!  -- as I have been doing lately, trying to get a feel what it was like in the early days of the Extreme Programming movement which became the Agile Alliance. Time sped by, and the next thing I knew it was close to midnight.

http://c2.com/cgi/wiki?WikiWikiWeb

What is Wiki Wiki Web?

From Wikipedia:
"The WikiWikiWeb is the first ever wiki, or user-editable website. It was launched on 25 March 1995 by its inventor, programmer Ward Cunningham, to accompany the Portland Pattern Repository website discussing software design patterns. The name WikiWikiWeb originally also applied to the wiki software that operated the website, written in the Perl programming language and later renamed to 'WikiBase'. The site is frequently referred to by its users as simply 'Wiki', and a convention established among users of the early network of wiki sites that followed was that using the word with a capitalized W referred exclusively to the original site".

"[...] The software and website were developed in 1994 by Cunningham in order to make the exchange of ideas between programmers easier. The concept was based on the ideas developed in HyperCard stacks that Cunningham built in the late 1980s. On March 25, 1995, he installed the software on his company's (Cunningham & Cunningham) website, c2.com. Cunningham came up with the name WikiWikiWeb because he remembered a Honolulu International Airport counter employee who told him to take the Wiki Wiki Shuttle, a shuttle bus line that runs between the airport's terminals. 'Wiki Wiki' is a reduplication of 'wiki', a Hawaiian language word for Quick. Cunningham's idea was to make WikiWikiWeb's pages quickly editable by its users, so he initially thought about calling it "QuickWeb", but later changed his mind and dubbed it 'WikiWikiWeb'.

Since I have been trying to somehow turn into a Real Programmer, I have spent a lot of time trying to learn how to incorporate Unit tests and Software Design Patterns into my automation development.

I stumbled on this site last year when I was trying to search for tips on Object Oriented programming.  and found out there were many definitions for what that means.

Watch out! You can spend hours trying to Find a Page and end up sucked in just like me.

Here are a few fun entries I found:

Writing Code


There is a huge section on Extreme Programming and Test Driven Development by Kent Beck that I would list as required reading for any manual QA person attempting to get into software development.

Make sure to read all about the Agile Manifesto.

After that is done, you can read about Software Design Patterns ( and the Gang of Four ) which help and AntiPatterns which hinder.

Around my workplace, the developers still talk about Design By Contract.

It also has entries on the two text editors still favored:

It has pages on the two main Integrated Development Environments (IDE) used now:

Writing Tests 


When it talked about Testing Frameworks I expected the section for JUnit written by Kent Beck and Erich Gamma. It also has a section on TestNG, added six years ago, probably by it's creator Cedric Beust.

They also cover various typed of Automated tests such as:

Building Software


What intrigued me is showcased build tools such as:

... Nothing yet on Gradle, though, a build tool we are starting to use more extensively at work.

Wiki Wiki Web. It's a nice little time capsule.

Happy Testing!

-T.J. Maher
Sr. QA Engineer,
Fitbit-Boston

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!
// Check us out on Facebook!

June 2, 2016

What I get out of blogging about code

On my lunchbreak, I was trying to explain to my co-workers what I get out of blogging about code I am writing at work. 

You know the expression, if you really want to see if you know something, try describing it to someone else? 

That's why I blog. 

Software development is brand new to me. It was scary when I first started. I was completely out of my comfort zone. But it got better. 

What I am learn at work has been a good foundation. There, I learn about the what, and the how.

It isn't until I start organizing my thoughts, creating a blog post, do I figure out the why.
  • How did the software development process I am using take hold? Who first blogged about the concepts I am using? Was it Kent Beck? Martin Fowler? Simon Stewart? Jim EvansUncle Bob
  • Who made the toolset I am using? When did it become adopted? Is it industry standard?
  • Although I may not understand it, where on GitHub is the open-source code? Can I understand how their project is constructed? Are there unit test formats I can borrow for my automation development? 
Through blogging, for me, comes understanding

And that's my thought of the day!

Happy Testing!

-T.J. Maher
Sr. QA Engineer,
Fitbit-Boston

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!
// Check us out on Facebook!

June 1, 2016

WebDriver development environment setup with Eclipse, Gradle, Hamcrest, and ChromeDriver

We started writing at work a new way of configuring an automated test framework. The original idea I had was that I could just bang out a simple automated test framework as practice, refactoring what I already have written in the past. When I started researching the new toolset, and my research notes were piling up, I then had the brilliant idea that this topic would make a lovely blog post.

I wrote about using IntelliJ. A reader asked me, What about an Eclipse version?

With this blog post, I will walk you through downloading Eclipse IDE for Java Developers, installing Buildship (the official Gradle plugin for Eclipse), setting up your Java environment, configuring Gradle, installing ChromeDriver, and creating quick-and-dirty WebDriver JUnit Tests, making assertions in the tests using Hamcrest, and refactoring those tests when we come across duplicate code.

This is a different setup than programming projects I have done before. We are using:
  • Eclipse  with Buildship will be the Integrated Development Environment (IDE).
  • Gradle to handle our dependencies, instead of Maven
  • JUnit 4.11 as a test framework instead of TestNG.
  • Hamcrest to handle the asserts, instead of the usual AssertTrue or AssertFalse found in JUnit or TestNG.







Please Note: You don't need an Integrated Development Environment (IDE) to code, just as you don't need Microsoft Word or any other word processing program in order to write a research paper. It is just easier to those who are more used to working with a Graphical User Interface.

If you want to be seen as a programming rock-star, learn to code in vim or emacs on a Unix command line. Me, I am more of a visual person and need the crutch of an IDE while coding.