Showing posts with label SeleniumGrid. Show all posts
Showing posts with label SeleniumGrid. Show all posts

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 image! https://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 Compose: https://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 Images: https://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 Extras: https://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.

Docker: https://www.docker.com/
SeleniumHQ Images: https://hub.docker.com/u/selenium/
Docker-Compose: https://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 4, 2016

Setup of Selenium Grid for Beginners: Brace yourself! We're Using the Command Line

Are you a manual tester who really wants to tinker with setting up Selenium Grid with your automated test framework, but is skittish about using a Command Line Interface? This blog entry is an attempt to walk you through it, every step of the way. Is there a detail I missed? Anything too vague? Please let me know in the comments section, below. Using the Command Line is tough, but it is something every tester needs to get used to... with time, you will have fun using it. (Or that is what I keep telling myself! :) )

  • Don't have an automated test framework set up? Take a look at a basic one I have for IntelliJ and Eclipse.

For this example, I will be setting up Selenium Grid a Windows 10 box, what I use at home. Feel free to set it up on whatever Mac or Linux/ Unix operating system you have. We aren't going to be doing a deep dive on any of the moving parts. That will come later. This article is focusing on the setup.

Directions can be found on SeleniumHQ's Grid 2 GitHub site: https://github.com/SeleniumHQ/selenium/wiki/Grid2