Start here

Sometimes your plans don’t matter

Some days, testing is easy and you know just what you’re going to accomplish. Then there are the other days. The days where the night before was a late release and you didn’t sleep, or your automation scripts are failing, or the test environment has crashed, etc. Some days, you’re not able to focus on what you thought were the priorities for the day. 

 I just had one of those days. I managed to knock out some awesome updates to our automation suite. Yes, I didn’t accomplish what I had originally planned to, but it felt good nonetheless. Sometimes your plans don’t matter. Let’s see what tomorrow brings. 

Snippet: Using a config file for CapserJS and PhantomJS

sample

Today’s Code Snippet is for using a JSON configuration file with CapserJS and PhantomJS.  I have been using JSON configuration files with my automation for a while now to help manage test URLs, user agents, users, etc.  It is a great way to make your automation more flexible and update settings for an entire application.   Below is an example of how your configuration file would look.

{
 "Env":{
 "PROD": {"url": "http://www.somewhere.com"},
 "QA1": {url": "http://qa1.somewhere.com"},
 "QA2": {url": "http://qa2.somewhere.com"}
 },

"userAgents":
 {
 "IE11": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko",
 "FF40": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1",
 "Chrome": "Chrome/45.0.2454.101"
 }
 }

In this configuration we have the URLs for testing as well as several user agents to select from that you will then use in your script.

var env = casper.cli.get("env");
 var browser = casper.cli.get("browser");
 var config = require('config.json');
 var address = config["Environments"][env]["url"];
 var agent = config["userAgents"][browser];

casper.test.setUp(function(){
 casper.start().userAgent(agent);
 });

casper.test.begin('', function suite(test){
 casper.start(address, function firstStep(){

});

So what does it mean?
In the code of your test script, you’re setting up the variables to select inputs from the command line for “env” and “browser”.  These will be used for all of the tests you have in the test script.  Let’s look at how we’re getting the user agent information.

var browser = casper.cli.get("browser");
var agent = config["userAgents"][browser];

We took the variable of “browser” from the command line and are now using it to navigate through the configuration file to find the appropriate information to pass into our test setUp.  This will allow us to run all of our test with this user agent information.

The command to execute would look like this:
casperjs test tests/ –env=QA2 –browser=IE11 –ssl-protocol=tlsv1

Taking it further.
The more that you put into your configuration file, the more options you have.  For instance, you could add to your user agent so that it includes viewpoint sizes.  This would be helpful for is you had a screen resolution minimum on your desktop site and for mobile device user agent settings.  I have included user account information in my configuration file where I include a setting in the environment section, such as “QA1″: {url”: “http://qa1.somewhere.com“, “type”: “test”}.  Then I would capture the type and use it for determining the password for the environment.  There are a number of ways to expand out your configuration file for testing.

What will you do with it?

Code Snippet: Using a config file for Ruby Automation 

Question:
I have two test environments plus production and I need to run automation against them. What’s the easiest way to store information for execution and testing?

Answer:
Create a configuration file for storing information such as environmental information and user information. This way you only have one place to update, rather than multiple. I like to use JSON files for this purpose.

Example (JSON)
:
{
Environment:
{
“QA-1”: “http://qa1.test.com/ “,
“QA-2”: “http://qa2.test.com/ “,
“PROD”: “http://www.test.com/
},
Account:
{
“username”: “test_user”,
“password”: “password”
}
}

Example (Code):

$env = ENV[‘LOC’]
file = File.read(‘config.json’)
$data_hash = JSON.parse(file)
testEnv = $data_hash[‘Environments’][$env]
ENV[‘base_url’] = testEnv
ENV[‘user_email’] = $data_hash[‘Accounts’][‘username’]
ENV[‘user_password’] = $data_hash[‘Accounts’][‘password’]

Note that ENV[] is a way of making a global variable that will remain constant throughout your execution of tests.

Important Meeting

IMG_0565Sometimes the most important meeting of the week is on Sunday Morning with your family. For me, that was true today. We had a lovely cup of coffee, while it lightly rained, and read a bit from one of my favorite papers (Financial Times). I hope you were able to recharge this weekend.

Been awhile

Hi Everyone,

Sorry for the delay in posts, but I have been really quite busy. I am in the process of writing some new posts, so check back in a few weeks.

Thanks.

How I use Evernote at Home

Last time I talked about how I use Evernote for work.  I always enjoy an app that I can take anywhere and serves more than one purpose. Evernote is one of those apps. This week I am talking about how I use Evernote for Home use.

  • Home projects – You can really replace “Home” with anything that you have projects-wise. I use Evernote for taking notes about things that need to get repaired around the house, how large a room is and samples of things that I would like for the house. This is a great way to organize things that you are wanting to do around your home. An example of this would be taking the measurements of a room and then looking at ikea.com.  Using the Evernote Webclipper I can capture images of things that would look good in the room, with their measurements. Then go to Ikea and know what I’m getting for the room. Another example would be keeping notes on how large an area of my yard is, how much sun the area gets and types of flowers that my wife and I would like. The options here are too many to list, but I’m sure you are getting the idea.
  • Blog Ideas – This post was written in Evernote app on Mac and PC, and it began on an Ubuntu machine through the Evernote web interface. Evernote is a great cross platform application! I have Evernote installed on my phone, tablet, work computer and home computer and whenever I need to, I can always use the web interface. This means that I can jot down a few thoughts wherever I am when I have a few free minutes.
  • Annual, Month and Weekly Goals – Having goals is part of life, no one wants to stay static in all aspects of their life. This means, you need to have a way to capture and track goals. In the “Work” section I called this “Personal Retrospectives and Planning”, because work and home are different places and should be treated as such, your goals for your personal life will be different than your professional life. That said, my tool for track both, is the same. For my personal life, I combine Evernote and Reminders on my phone. I write out my goals for the year in Evernote and break them out into Long, Intermediate and Short terms. Using the same names in Reminders, I then transfer them and set due dates. The due dates are really estimates for when areas should be covered. I use Evernote to take notes along the way to track progress and even setbacks. Not everything goes well the first time out.
  • Planning Weekend Trips – From the same book series by Laura Vanderkam, “What the Most Successful People do on the Weekends”, Laura talks about planning for the weekend. Since we usually only have two days for working around the house and relaxing, it makes sense to prepare for them. To be honest, this one can be a bit difficult. I do like to be a bit lazy on my days off; however, having a guide to what we will do can be very exciting. Sometimes it’s simply having something to look forward to that becomes rewarding! Share an Evernote notebook between you and your significant other for weekend plans and getaways and start looking forward to refreshing weekends!

Those are a few of the ways that I use Evernote at work and at home. How are you using Evernote?

How I use Evernote at Work

The other day I came across an article talking about the Evernote App and how great it is. I use the Evernote App for work and personal, and I’ve even recommend it to others at work. So I was hoping to find some great new gems on how the App could be used. Instead I found a mostly boilerplate outline. So, I have outlined a few of the different ways I use Evernote in my daily life. This article has been broken into two, today is all about work. The article about home will come out next week.

Below, is my list of how I use Evernote for work.

  • Test Ideas – Test cases are better kept in a test case management tool, but having a test strategy points you in the right direction. I like to create a notebook for each project I’m working on with separate notes for each ticket. In the individual notes I write out the important areas that need to be covered. This helps me keep the important things in focus and write better test cases.

  • Work Journal – If you work for a development company, then you probably know about Agile Scrum. I keep a running journal of what I work on for the project teams I’m a part of. This makes the “what I worked on” section of any standup easier.

  • Test Instructions – There are many times when you need to have a list of instructions for accessing and then testing a new feature. This allows me to have the instructions with me everywhere I need them and I can update them as needed. Once the process is documented correctly, I can update the test cases and our company wiki.

  • Meeting Notes – This should be self explanatory, but having a note taking system for meetings will help you remember what you’re committed to. Evernote is great at indexing, so searching is a breeze. For those times where I don’t take my laptop and only have a mobile phone, I jot down the important items in Evernote there. Also, I keep a pen and notebook with me to take some quick notes throughout the day about projects or items I’m working on. I transfer those notes to Evernote so that I can always access them.

  • Personal Retrospectives and Planning – I know this sounds very “Agile Scrum” but it’s actually helpful when working on self improvement and goal setting. I originally got the idea from “What the Most Successful People Do at Work” by Laura Vanderkam. I use my time to think about what I accomplished and where I feel short on my goals for the week. Then focus what needs to be accomplished in the next week. I keep the notes in Evernote and each month I look back at them to measure progress. This is something new that I’ve started, but I plan to keep this one going.

These are a few of the ways that I use Evernote at work. How are you using Evernote?

Test Cases: Know when to hold ’em and when to fold ’em

Test cases are an important part of the Software Development Life Cycle (SDLC), they are QA’s documentation that something was tested. Of course I could simply say “Test cases, good”, publish the article and move on, right?

So instead, lets talk about test case management. This is the better topic, because it’s much more expansive. Test case management covers how long you keep your test cases for and balancing the number of test cases you write for a feature. I won’t get into the various softwares used for managing test cases, because there are too numerous to review. Please note, that this will be a very subjective article since there isn’t any hard rules. This is a decision that needs to be made by the team, leadership and organization.

I prefer to keep test cases clean and to the point. This means thinking about the audience. Test cases are documentation for a Quality Assurance department but they can be consumed by QA, Engineering, Product and even Executives (on occasions). Usually though, they are kept for QA, Testers and Engineering. Testers are not always part of the Scrum team, every organization treats them differently. When your test cases are being passed on to people outside of your team, you will want them to be more detailed to show every area of change, the same is true for new hires. Most of the teams I’ve worked with have had no outside testers, so keeping the tests to the point has been easy.

Also I like to focus on the negative testing or the ‘testing around the corner’ for some projects. I look at this at a project by project basis. You might be asking what ‘testing around the corner’ means. By that I mean, testing related or similar sections of the code that have NOT been altered by the team. Code can be a living creature that reacts differently to surgery or ‘mutation’ at times. The longer you test an application, the more you find Heisenberg’s Uncertainty Principle in play. Basically, you can know where something is, but not know precisely how fast it is going. Some code bases work the same way, you can know where the developer is altering code, but not know precisely how many related changes need to be made.

Finally, lets talk about when to fold test cases. When I create test cases, I identify which test cases need to get run at each step of the deployment channel. You don’t really need to do every test cases on each server out the door, right? The goal is test one percent (or less) of the test cases on production, after all, you don’t want to tamper with production data too much. The next step is deciding if those cases all need to be run again with each deploy or if then can be reduced as confidence of the feature stability increases. After a period of time, you should not need to be running the same test cases deploy in and deploy out. Be familiar with your organization’s documentation requirements and talk openly with your QA Leadership on when to end test cases.

In the end, this is all subjective. Some test cases will always need to be run because they are so important to the business, others have a shorter life span. Everyone has their preferences for how detailed the test cases should be. Only you and your team can decide what is best.

New Position

Recently I decided to accept a new position, which meant that I had to say goodbye to my now “previous” company. It was taken well and I was given a lot of well wishes for my new position. All in all, the transition went well and I have already started at my new company. I am the new guy and I’m looking forward to everything that entails!  

Wish me luck!

Keeping Your Company Culture Creative

I came across this article the other night titled “5 Ways to Bring Creativity Back to Your Culture” (by Marc Barros, Inc.com). Each point was well structured and made sense. Keeping your company culture a creative one is very important.

The first two points of “Offer Unlimited Vacation” and “Let Employees Work Remotely” are very valid and beneficial to employees. Afterall, recharged employees are energized employees. Your employees are working towards your vision after all. “Ditch the Meetings” is really a pipe-dream of every employee. Work to reduce the number of meetings allowed in a day. Move the meetings to the afternoons and allow employees to be creative (and productive) in the mornings when they are most refreshed.

I would offer one more suggestion, encourage your employees to ‘turn off’ when they leave work for the day. Help them understand that they don’t need to have their company emails on their smartphones. Nearly 98% of the time, there isn’t a need to respond to an email at 10 pm. This one thing, will probably help keep your employees more creative from day to day, because they are refreshed.

Problem solving, product development, and keeping customers interested in your company are the bread and butter of your company’s growth. Don’t allow yourself to lose your edge. Don’t allow your employees to lose their edge.