May 31, 2016

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

This blog post should be titled, "How I Spent My Memorial Day Weekend".

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. Hey, presto! Ten hours of my weekend disappeared, with me locked away in my home office, missing out on the pleasant sunshine we had. At least my wife and I managed to join the epic Space Battle on the Boston Common: Two hundred nerds swinging around plastic light-up lightsabers at each other.

With this blog post, I will walk you through downloading IntelliJ, 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:
  • IntelliJ 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.

Our Integrated Development Environment (IDE)
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.

May 27, 2016

How to Clone a Repository in IntelliJ

Want to fiddle around with any code that I have created on GitHub, such as RESTful Testing Using Stripe at https://github.com/tjmaher/RESTful_Testing_Using_Stripe?

This is a walkthrough on how to clone a repository through IntelliJ, an Integrated Development Environment (IDE) that I use for work.

What is GitHub, from How-to Geek:

"To understand GitHub, you must first have an understanding of Git. Git is an open-source version control system that was started by Linus Trovalds – the same person who created Linux. Git is similar to other version control systems – Subversion, CVS, and Mercurial to name a few.

May 26, 2016

Webinar Notes: Dave Haeffner, "Practical Tips and Automation Tricks For Selenium Test Automation"

If you are brand new to automated browser testing and are looking someone who can provide some hand holding, there is no better instructor than Dave Haeffner.

Dave gave yet another wonderful talk on automated testing, sponsored by Sauce Labs.

From Sauce Labs:
https://saucelabs.com/resources/webinars/practical-tips-and-tricks-for-selenium-test-automation

"Want to learn how to use Selenium like a Pro? Join Dave Haeffner - author of The Selenium Guidebook - as he steps through the best and most useful tips & tricks from his weekly Selenium tip newsletter (Elemental Selenium)".



"Topics covered include:
  • "Headless test execution
  • "Testing HTTP status codes
  • "Blacklisting third-party content
  • "Load testing
  • "Broken image checking
  • "Testing "forgot password"
  • "Working with A/B testing
  • "File downloads
  • "Additional debugging output
  • "Visual testing & cross-browser testing"


Slides have been shared via SlideShare:



... The only problem I found with Dave's Elemental Selenium newsletter: Too much Ruby and not enough Java.

We use Selenium WebDriver 2 with Java for our automated browser tests at work. I can't just rip off or steal or copy or borrow or repurpose his code without much modification like I do on StackOverflow.

Hrm... I discovered like almost everything else worthwhile, code examples for Dave's Elemental Selenium tips are on GitHub!

It would be good practice for me to go over his code repository, find a chapter lesson that only lists only a Ruby example, and rewrite an example in Java.

This should be fun! Other than my fun little "weekend work" projects, I haven't made updates to anything besides Fitbit-Boston's test automation framework.

This should be fun! I think I found my next fun weekend work project!

Happy Testing!

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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

*DING!* 100th Post!

Wow. I can't believe that yesterday's post on Simon Stewart talking about Selenium WebDriver was the 100th post I have created here at Adventures in Automation.

This blog was started back on January 24, 2015 as a place to organize my research notes I collected as I was trying to break into the world of automated test development. Now that I am a full-fledged automated test developer, I continue to blog about whatever I am learning at work to help make the new concept stick, inventing new little side-projects to reinforce what I am learning. Hopefully these articles and code samples have helped you, too!

The act of putting together this blog has made me a better software developer.

Thank you, dear reader, for being a part of it.

Thank you most of all to:
... and anyone who has given me such excellent Feedback about this blog.


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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

May 25, 2016

Notes: Selenium 3, the Spec, and Onwards by Simon Stewart

Title: Selenium 3, the Spec, and Onwards
Speaker: Simon Stewart, Selenium Project Lead
Host: Applitools
Date: Wed. May 25, 2016 @ 1:00 PM EDT
Duration: 60 minutes

Summing up Simon's Webinar:
  • Selenium 3 (no release date given) will be a removal of all old Selenium RC code into a legacy library called "leg-RC".
  • Selenium 4 will move closer to the new W3C WebDriver Protocol they have been pushing for.
  • Selenium 5 will be the full W3C WebDriver.

Before that information was given at the end of the talk, Simon took a long walk down Memory Lane...

May 24, 2016

Live Blog: 5/24/2016: Meet the Fitbit Security Team @ Fitbit-Boston

A few weeks ago, Fitbit's Security team organized a talk through the Security of Things Meetup:
What: Meet The Fitbit Security Team!
When: Tuesday, May 24, 2016, 6:30 PM
Where: 1 Marina Park Drive, Boston, MA
Signup At: http://www.meetup.com/The-Security-of-Things/events/231198245/ 
"[T]he folks at Fitbit have extended an invitation to the Security of Things Meetup: an opportunity to meet with Fitbit's product security team next Tuesday, May 24th at the FitBit offices in downtown Boston.

"This is a great opportunity to talk with the folks responsible for securing the hottest wearable technology in the market right now. Fitbit isn't just a wearable activity monitor: its a sensing platform for a wide range of health monitoring activities: from fitness and weight loss to sleep monitoring and social networking.

"Come hear about how the Fitbit team addresses the security and privacy challenges of its growing and enthusiastic user base, while also developing next generation features to keep their technology relevant and cutting edge".


Are you a Firmware / Embedded Engineer? Fitbit-Boston needs your help!

Are you a Firmware / Embedded Engineer? Fitbit-Boston needs your help!

From Jason Y. Sproul, Firmware Manager:

"We have launched a survey and sweepstakes focused on embedded/firmware test engineers in the Boston area. We want to learn more about the local job market, talent, and where people work so we can better focus our recruiting and hiring efforts. We want to build a great firmware test engineering team alongside our great engineering team.

"Entrants from MA, NH, ME, and RI can win a Fitbit Blaze for answering 6 quick questions. We’ve posted it on the Fitbit LinkedIn feed. Please like it and share it, or share the following link on social media!"


Happy Testing!

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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

May 20, 2016

Switching from Manual Testing to an Automated Testing Career in Five Difficult Steps

It wasn't too long ago when I was an out-of-work software tester without much experience coding. There are many manual testers -- people who test web and mobile applications the same way customers use them, with a mouse, a keyboard, or a finger on a touch screen -- who are trying to switch to automated testing. I wrote at length elsewhere about my transition. With this blog post, I wanted to list more of a summary, hoping that other people in the same boat as I was would find it helpful.



Coding: Getting used to it


To get used to coding again, I worked through all of the examples in the free eBook Learning Python the Hard Way: http://learnpythonthehardway.org/book/ to get used to working with a programming language. I really needed the hand-holding this book offered. Working with Python helped, since it is a language with less ramp up time.

Then, I purchased Java for Testers at http://javafortesters.com/ to ease me into the Java programming language. Anything by The Evil Tester, himself, Alan Richardson, is made of awesome.

Java 8 and Python 2.7.11 seem to be the heavy hitters, when it comes to programming languages. Some companies are still trying to transition from Java 7 to Java 8, but they will do it eventually. Python 3? It came out years ago and hasn't been fully adopted yet. People would rather stick with Python 2 and pull in new features than switch to Python 3.

Doing the Coursework


I purchased Alan Richardson's online course Selenium 2 WebDriver Basics with Java: https://compendiumdev.zenler.com/courses/selenium-2-webdriver-basics-with-java ($299) ... Work through all the Preview material if you can to see if you like his course, his videos, his humor, and his Scottish accent.

I used Alan Richardson's mildly outdated Selenium Simplified free guide to Get Started: http://seleniumsimplified.com/get-started/ ... I set up IntelliJ as an Integrated Development Environment (IDE) on my home PC. Either this or Eclipse seems to be the new standard.

Doing the Coursework right!


When working through an online course, if it is showing in the video someone typing code into IntelliJ, I am typing, too!

The left half of my screen contains the video playing in a browser. The right half of my screen is filled is my IntelliJ window.

... The instructor types? I type. The video executes the code? I do too... I accidentally wasted two months simply passively listening to the lectures. I retained completely no information I supposedly learned.

Create Code of My Own


Once I got a hang of things, I started looking around for things to automate, such as Dave Haeffner's test site, "The Internet" on https://github.com/tourdedave/the-internet and http://the-internet.herokuapp.com/ .

Share the Code!


I signed up for a GitHub account, creating a coding portfolio displaying automation coding examples I came up with: https://guides.github.com/activities/hello-world/

Once I had the GitHub account filled with coding examples, I could prove to employers that I had what it takes to do the job.

Hope that helps!

Happy Testing!

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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

Adventures in Automation is now on Facebook!

Like Adventures in Automation?

Want to know when there are new posts to this blog but don't feel like Subscribing Via Email?

Visit Adventures in Automation's new Facebook page!

Careful! I think the paint is still wet there...

You can keep up with new posts either there, signing up to our RSS Feed, Subscribing Via Email, or Following me on Twitter at @TJMaher1.

And as always ... Happy Testing!

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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

May 18, 2016

Fitbit-Boston talks: Come hear about Fitbit and security, Tues. May 24!

If you happen to be in Boston, sign up to hear a talk given by the Fitbit Security Team, hosted by the "Security of Things" Meetup!

What: Meet The Fitbit Security Team!
When: Tuesday, May 24, 2016, 6:30 PM
Where: 1 Marina Park Drive, Boston, MA
Signup At: http://www.meetup.com/The-Security-of-Things/events/231198245/



From the Security of Things Meetup

http://www.meetup.com/The-Security-of-Things/events/231198245/
"[T]he folks at Fitbit have extended an invitation to the Security of Things Meetup: an opportunity to meet with Fitbit's product security team next Tuesday, May 24th at the FitBit offices in downtown Boston.

"This is a great opportunity to talk with the folks responsible for securing the hottest wearable technology in the market right now. Fitbit isn't just a wearable activity monitor: its a sensing platform for a wide range of health monitoring activities: from fitness and weight loss to sleep monitoring and social networking.

"Come hear about how the Fitbit team addresses the security and privacy challenges of its growing and enthusiastic user base, while also developing next generation features to keep their technology relevant and cutting edge".
Fitbit-Boston is a short walk from the Commuter Rail / Red Line stop, South Station at One Marina Park Drive on the 7th floor. ( map )
Happy Testing!

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

// QA Engineer since Aug. 1996
// Automation developer for [ 1 ] year and still counting!

STAREAST Notes: David Dang, "Open Source Test Automation: Riding the Second Wave"

David Dang, from Zenergy Technologies, VP of Automation Solutions, gave a very entertaining and humorous talk on a brief overview of test automation as it was, how it is now, and points to consider a company just starting out with test automation should consider. STAR East Virtual Conference, a TechWell Event broadcasted from Orlando, FL, Wednesday May 4th, 2016.

According to David's STAR East bio, "For more than seventeen years, David Dang has been a leader in the test automation industry. As VP of automated solutions for Greensboro, NC-based Zenergy Technologies, David spearheads the development of advanced frameworks that emphasize reusability and reduce maintenance efforts. He is an expert in all major commercial automation tools as well as open source tools such as Selenium and Jenkins. On the mobile front, David uses advanced concepts to design optimal frameworks using mobile automation toolsets including Perfecto and Appium. In addition to his high-level consulting engagements for Zenergy’s clients, David is in high demand as a presenter at major software quality assurance and testing conferences".

May 16, 2016

STAREAST Notes: Dorothy Graham detailing how planting a test automation framework is like caring for an orchard

Dorothy Graham ( @DorothyGraham ), a software tester for over forty years, spoke at the STAR East Virtual Conference, a TechWell Event broadcasted from Orlando, FL, Wednesday May 4th, 2016 during the Lightning Talks section, "Lightning Strikes the Keynotes". The following is a (mostly) accurate transcript of her talk, taken by T.J. Maher.


"Test automation is sooo easy.

"Let me rephrase that. Test automation seems to be really easy, at first. You can see your first demo, you write your first test [...] and it looks so easy!

"But if you want a long lasting asset for your company [...] that's a different matter altogether. It's like the difference between seeing some low hanging fruit, and picking the fruit off the tree and thinking, 'Wow, that was easy. This is so good!' and the other aspect: What if you want to build an orchard to grow enough fruit to feed a small town? It's an entirely different matter.

May 14, 2016

Builder Pattern: Creating an AddressBuilder

Earlier, I talked about why software developers would use a Builder Pattern to solve problems such as the bad habit of too many overloaded methods telescoping out of control. With this post, I was going to go over a bit more of what I have found, and give a simple example of an AddressBuilder.

Down the road, I was going to test out I could use this pattern to create a ProductBuilder (such as ALTA.BLK.LARGE.US) that I could use at my workplace.

Much further down the road, I was going to experiment with creating a TestBuilder, where I could set different test parameters, such as placing a standard shopping cart order with multiple products, set the shipping level, and payment types.

... For now, though, I'll stick with attempting to create an AddressBuilder.

May 4, 2016

Setting up a Virtual DEV Environment with VirtualBox, Vagrant, and Docker

The Source Material: Test-Driven Java Development


We will be covering in this blog post setting up a virtual development environment that has Ubuntu, Docker, and Mongo DB installed. We will using VirtualBox and Vagrant to set up the virtual machine.

Are most of the technologies I mention in the previous paragraph new to you? Me, too! I'm a software tester by trade, not a developer or a SysOps guy. We'll just have to figure out this stuff together!

As a guide, I purchased a copy of Viktor Farcic's Test-Driven Java Development, printed by PACKT Publishing. We will be using Chapter 2: Tools, Frameworks and Environments as source material.

Since I am doing this on my system at home, I will be setting it up on my Windows 10 machine. Feel free to use whatever operating system you have at home.

May 3, 2016

Notes on Accelerating DevOps Collaboration with Sauce Labs & JIRA

Name: Accelerating DevOps Collaboration with Sauce Labs & JIRA
Date: Tuesday, May 3, 2016, 2:00 pm
Webinar HostSauce Labs

About the Webinar:


"Software Development teams are looking for ways to speed up their development process while maintaining high quality applications. In order to help meet this challenge, Sauce Labs is proud to announce the release of the first automated test cloud integration with Atlassian's JIRA.

"The Sauce Labs Plugin for JIRA allows JIRA users to increase the speed of their development cycles while maintaining quality and reducing cost. The plugin seamlessly connects the rich testing metadata that Sauce Labs provides with an organization's JIRA instance. Teams who are looking to adopt DevOps/Continuous Delivery practices for the first time will find this tool especially compelling".