Monday

WebDriverManager - Solution to the selenium binaries


What is WebDriverManager ?

Problem: 

In order to use some browsers (for example Chrome,Internet ExplorerOperaMicrosoft EdgePhantomJS, or Marionette) you need to download a binary which allows WebDriver to handle the browser. In addition, the absolute path to this binary must be set as Java variables, as follows:
System.setProperty("webdriver.chrome.driver", "/absolute/path/to/binary/chromedriver");
System.setProperty("webdriver.opera.driver", "/absolute/path/to/binary/operadriver");
System.setProperty("webdriver.ie.driver", "C:/absolute/path/to/binary/IEDriverServer.exe");
System.setProperty("webdriver.edge.driver", "C:/absolute/path/to/binary/MicrosoftWebDriver.exe");
System.setProperty("phantomjs.binary.path", "/absolute/path/to/binary/phantomjs");
System.setProperty("webdriver.gecko.driver", "/absolute/path/to/binary/geckodriver");
Solution
This piece of software is a small library aimed to automate the Selenium Webdriver binaries management within a Java project in runtime.

What it does?

  1. It checks the latest version of the WebDriver binary file
  2. It downloads the binary WebDriver if it is not present in your system
  3. It exports the required Java variable by Selenium WebDriver

Usage
In order to use WebDriverManager in a Maven project, first add the following dependency to your pom.xml:
<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>1.4.6</version>
</dependency>
So far, WebDriverManager supports ChromeOperaInternet ExplorerMicrosoft EdgePhantomJS, or Marionette as follows:
ChromeDriverManager.getInstance().setup();
InternetExplorerDriverManager.getInstance().setup();
OperaDriverManager.getInstance().setup();
EdgeDriverManager.getInstance().setup();
PhantomJsDriverManager.getInstance().setup();
MarionetteDriverManager.getInstance().setup();


WebDriverManager (Copyright © 2015-2016) is a personal project of Boni Garcia licensed under LGPL License. Comments, questions and suggestions are always very welcome!
Source: https://github.com/bonigarcia/webdrivermanager

Marionette ?


Background:

Now called the GeckoDriver

Future:
  • Marionette will be turned on by default from Selenium 3
  • Ideally when Firefox 52 comes around you will just update to Selenium 3
Happy Testing!

Thursday

slf4j failed to load class


Problem: If you are getting this error message every time you run your slf4j failed to load class framework org.slf4j.impl.staticloggerbinder

Solution:

If you use maven just add the following













Happy Testing!

Wednesday

pip behind corporate firewall


Problem: Unable to install virtualenv using pip behind the proxy

Solution: Similar to what we did when we installed git http://go-gaga-over-testing.blogspot.com.au/2015/04/setup-github-within-companys-firewall.html behind a company's firewall we shall set the proxy

pip install --proxy="myproxyname.mydomain.com:8080" virtualenv

Or 

pip install --proxy="http.proxy http[s]://userName:password(encoded)@proxyaddress:port" virtualenv

GitHub search results as a feed?


Is there a way to search the git hub results so you can have a feed of recently updated repositories or users you follow etc?

The answer is yes

GitHub has an API for search https://developer.github.com/v3/search/

Example of how it works?

Let's say you want to search all test automation repositories written in Java.
Your query might look like this.

https://api.github.com/search/repositories?q=automation+language:java&sort=stars&order=desc

In the above example q is the search item automation
and language is java
and sort is based on stars
and order is desc

Parameters

NameTypeDescription
qstringThe search keywords, as well as any qualifiers.
sortstringThe sort field. One of starsforks, or updated. Default: results are sorted by best match.
orderstringThe sort order if sort parameter is provided. One of asc or desc. Default:desc
To check for more queries and search parameters read these:
https://help.github.com/articles/searching-repositories/
https://help.github.com/articles/search-syntax/

Use http://codebeautify.org/jsonviewer or any other JSON viewer to get your results the way you would like.

Core SAFS Project for Test Automation Engines and Services



Here is an interesting project on GitHub  that provides test automation support and services

What does SAFS provide?

Software Automation Framework Support
Project Url/ Code: https://github.com/SAFSDEV/Core

Tuesday

Watch / Notifications projects in JIRA



Problem: How do I bulk watch issues on my JIRA project?

Scenario: You are a Test Manager with a program nearing release. You want to be notified when someone files a blocker or critical issue.

Solution:
  1. Create a filter
  2. Add a subscription


  • Now click details link of the filter
  • We can then subscribe to that filter.\


Whenever a new issue matches that filter, JIRA will email you. You can set notifications to whatever period you want. For example, you can make sure the list of critical issues are in your inbox every morning. As new issues come in, you can decide if you want to watch them to follow all the issue traffic.

Bulk Watch




Monday

Repost - The code that took America to the moon was just published to GitHub, and it’s like a 1960s time capsule


When programmers at the MIT Instrumentation Laboratory set out to develop the flight software for the Apollo 11 space program in the mid-1960s, the necessary technology did not exist. They had to invent it.

They came up with a new way to store computer programs, called “rope memory,” and created a special version of the assembly programming language. Assembly itself is obscure to many of today’s programmers—it’s very difficult to read, intended to be easily understood by computers, not humans. For the Apollo Guidance Computer (AGC), MIT programmers wrote thousands of lines of that esoteric code.

Here’s a very 1960s data visualization of just how much code they wrote—this is Margaret Hamilton, director of software engineering for the project, standing next to a stack of paper containing the software:






Margaret Hamilton(NASA)

The AGC code has been available to the public for quite a while–it was first uploaded by tech researcher Ron Burkey in 2003, after he’d transcribed it from scanned images of the original hardcopies MIT had put online. That is, he manually typed out each line, one by one.

“It was scanned by a airplane pilot named Gary Neff in Colorado,” Burkey said in an email. “MIT got hold of the scans and put them online in the form of page images, which unfortunately had been mutilated in the process to the point of being unreadable in places.” Burkey reconstructed the unreadable parts, he said, using his engineering skills to fill in the blanks.

“Quite a bit later, I managed to get some replacement scans from Gary Neff for the unreadable parts and fortunately found out that the parts I filled in were 100% correct!” he said.

The effort made the code available to any researcher or hobbyist who wanted to explore it. Burkey himself even used the software to create a simulation of the AGC:
Continue reading here:

Source: 

http://qz.com/726338/the-code-that-took-america-to-the-moon-was-just-published-to-github-and-its-like-a-1960s-time-capsule/

Monday

The weird reason I learnt about Docker: Video recording embedded in Selenium Grid reports



From my earlier post "Docker + Compose + Selenium Grid = Automation awesomeness!" you would have seen that "video recording" was the reason that made me stumble upon Docker.

So what options do we have when we want to accomplish videos embedded in our html report when playing with Selenium Grid.

  1. vnc2flv
  2. Monte
  3. avconv
Here is a docker image that supports vnc recording: https://github.com/rnorth/vnc-recorder
Another really good docker image with selenium grid sample tests: https://github.com/sskorol/docker-selenium-grid

The recording option used here is avconv:
  • Which is a child of ffmpeg
  • the only one that supports mp4 format
  • Therefore can be easily attached to a HTML5 webpage
To read more there is an excellent blog poast from the github page: http://qa-automation-notes.blogspot.com.au/2016/04/docker-selenium-and-bit-of-allure-how.html


Other Docker images that support windows and Unix:

Selenium in Docker with Chrome & Firefox plus video recording support