Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

April 28, 2018

Setting up Ubuntu Linux with Docker

Let's say that I only have a Windows 10 system at home, and I wanted to take a refresher course, Michael Hartl's Learn Enough Command Line to Be Dangerous. There are many ways to get Linux on a Windows machine. The easiest I found? Docker. Besides, they use Docker at work, so I need to practice that, too.

There are some technologies that keep on popping up again and again in my short career as an automation developer. One of those is Docker. "Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime", according to AWS's article, What is Docker?

Back in July 2016, I was doing some weekend work to see if my company might be able to set up Docker with the new Docker Toolbox, with me working with our DevOps team, implementing a Selenium Grid using Docker-Selenium to possibly offload some of the cost of Sauce Labs, which can get pricey. I was inspired by a Selenium Conf India 2016 talk, "Testing as a Container". The month before, I was also tinkering with Setting up a Virtual DEV environment with VirtualBox, Vagrant and Docker, based on a Test Driven Java Development book I was reading. The projects were nixed, and I moved onto other things.

Years later, in March 2018, I would revisit this project, Starting a Selenium Grid using AWS + SeleniumHQ Docker images and Docker Compose.

That's how it goes jumping from gig to gig the past few years: from workplace to workplace the technology stack changes. Hopefully with my current full time permanent gig I can stop tinkering, settle down for five or six years and actually get good at some of this stuff, instead of always feeling that I am paging through the book "How To Skydive" while I am in free fall.

With this blog article we are not doing anything so fancy. All I want to do is bring up a Docker image containing Ubuntu. You see, as much as I love my work Macbook, at home I always use a Windows machine. Every few months I am tinkering with a new tool or technology, installing the Windows version of whatever I am tinkering with. It gets cluttered with half-forgotten tools. Maybe if I use Docker, I can start using a real Linux environment while at home instead of the half-baked hybrid I have been using.

Yeah, I could Start a Linux Machine with Amazon Web Services Free Tier, which I researched back in January of 2018 ... but between you and me, I worry about leaving a process running, and being stuck with a hefty monthly bill. Luckily, Docker for Windows would work just as easily!

Docker Community Edition



July 11, 2016

Test The-Internet 2.0: Setting up Selenium Grid: RemoteDriver and DesiredCapabilities

Recap: Since May 2016, we've been blogging about forming a new automated test framework using Dave Haeffner's test site, The-Internet.

Picking Gradle as the build tool, we walked through how to create unit tests, just to make sure everything is still working as we make changes to the project, setting them up in JUnit and Hamcrest in both IntelliJ and Eclipse.

Like the two frameworks we built last year, we are using CSS Selectors to find the web elements on a page. We grouped together pages using the Page Object Model and PageFactories. After walking through the reader with experimenting with first Selenium Grid and then Docker, we set up Selenium Grid using official Docker images from Docker Hub.

... I should call this blog post, "How I spent my summer vacation". Each time we rewrite our test framework, I experiment on this blog with tools and technologies we are using at work. Instead of spending four hours reading a technical manual, I'm spending the same amount of time getting my hands dirty, taking notes all along the way. It takes no time at all to turn all that research I collected into a blog post.

With this blog post, we will be using RemoteWebDriver to bring in the browser nodes listed in our Selenium Grid, connecting them with DesiredCapabilities to help run our tests.

July 9, 2016

Using Docker + Jenkins for Continuous Integration: Assorted Links

So much to do! So little time! There are so many pieces I need to add to my new little automated test framework, Test_TheInternet_2.0 found at https://github.com/tjmaher/Test_TheInternet_2.0. You can see what is on my "wish list" at the end of this blog post.

But what I really want to do is experiment with setting up my own Jenkins environment on my home system, something DevOps does at my workplace. I create, at work, Jenkins jobs to run tests, but it is not the same thing as being able to tinker with Jenkins Plugins, set up the system, etc.

I found out the other day that on Docker Hub, Jenkins has its own Docker imagehttps://hub.docker.com/_/jenkins/! That is definitely something I really want to tinker with.




Instead, here are some links that I was planning on checking out that I wanted to share with you. I probably won't be able to get to this for another few months or so, at the rate I am going:


The plan is to finish off the automated test framework we started: Test_TheInternet_2.0. You can see the source code at https://github.com/tjmaher/Test_TheInternet_2.0
  • RemoteWebDriver: Taking our DesiredCapabilities we touched upon, and expand it. 
  • Docker Composehttps://docs.docker.com/compose/: Bundle together scaling up or down Selenium Grid browser nodes, downloading Selenium Grid, starting up a Hub, and starting up various nodes.
  • MicrosoftWebDriver: ( Link ): How to incorporate Microsoft Edge into your tests.
  • Microsoft Virtual Imageshttps://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ add IE8, IE9, IE10, IE11 on Windows 7 or IE 11 and Microsoft Edge to Windows 10 nodes to your Selenium Hub! Just use VirtualBox, Vagrant, HyperV (Windows), VMWare, or Parallels (Mac). Take a snapshot of the images because the originals are only good for 90 days. (What, no Docker solution? Gee, Microsoft, do you always have to be different?)
  • Selenium Grid Extrashttps://github.com/groupon/Selenium-Grid-Extras
... I also want to check out what Sauce Labs has for its own sample test framework in Java-Junit-Selenium: https://github.com/saucelabs-sample-test-frameworks/Java-Junit-Selenium

As always, Happy Testing!

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

// BSCS, MSE, and QA Engineer since Aug. 1996
// Automation developer for [ 1.5 ] years and still counting!
// Check out Adventures in Automation and Like us on Facebook!

July 7, 2016

Setting Up Selenium Grid with Chrome and Firefox browser nodes from Docker-Selenium

Please Note: This blog post will be using the official SeleniumHQ's Docker-Selenium project, not Leo Gallucci's Docker-Selenium project

We will be experimenting, in this blog post, with installing Docker, deploying Selenium HQ's various Chrome and Firefox Docker images, regular versions, and using them with their Docker image of Selenium Hub.
Later on, we will tie this in with my BasicWebDriverFramework_Gradle, including into the project our work with PageFactories, and adding RemoteWebDriver and DesiredCapabilities functionality. In the post after this, we will build on this information, using Docker Compose to scale Selenium Grid.

Dockerhttps://www.docker.com/
SeleniumHQ Imageshttps://hub.docker.com/u/selenium/
Docker-Composehttps://docs.docker.com/compose/
Why install Selenium Grid in a container system like Docker? Docker is built to help make configuring systems easier, helpful if you are setting up Selenium Grid with one Selenium Hub and multiple Chrome and Firefox nodes.

Normally, to set up Grid, you would:

  • Download Selenium-StandAlone-Server
  • Start up the Selenium Hub: java -jar selenium-server-standalone-2.53.0.jar -role hub
  • Start up various nodes: java -jar selenium-server-standalone-2.53.0.jar -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=2 -browser browserName=chrome,maxInstances=2
... Then the Selenium Grid would be ready to use at http://localhost:4444. 

With Docker, it is still that same three step process... except we can bundle all of those three steps into one with Docker Compose. That is for later blog posts. First, though, let's talk about Docker...


July 5, 2016

Selenium Conf India 2016 Talks: Placing Selenium Grid in a Docker Container

Selenium Conference India 2016 was held June 24, 2016 to June 26, 2016 in Bangalore. It's like Christmas for me, after every conference when they release the presentation slides the presenters used, indexing them all on the schedule at https://confengine.com/selenium-conf-2016/schedule. Simon Stewart, creator of WebDriver, gives his State of the Union. Automation developers showcase their work. You get to see what other automation developers are doing with the tool.

Videos usually are released a few weeks after the event.

I noticed that there were two talks and a workshop that dealt with a technology I was tinkering with for the past few months: Setting up Docker Containers. They were pairing Selenium with Docker to help them with testing.

July 2, 2016

Setting up Docker the "easy" way on Mac or Windows: The Docker Toolbox and the Get Started Guide

Toolbox installer
It's the Docker Toolbox for Easy Installation!

I've been on a quest since I became an automation developer, documenting everything I have been doing adding to the automated test framework at my workplace. Because I didn't start at square one, there are things I wonder about...

The Past: Browser images on Virtual Machines


When performing browser testing around a decade ago, I used to use VMWare to setup numerous virtual machine images for my testing team. The images contained the multitude of browsers and platforms configurations we needed. I would configure and place them the shared drive at whatever company I was working on. If we wanted to see how our web application looked on a clean install of the now defunct Netscape Navigator and Windows NT, and compare that with IE6, IE7, and IE8, our entire testing team could blow away whatever previous virtual machines they had on their desktop, and copy whatever was needed that day to their computer.

I am on a quest to find that type of ease-of-use.


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.