JetBrains blogs

Minimalist Software Engineering

Do you approach software engineering as a minimalist?

The fastest code is the code that doesn’t run at all.

Running fewer SQL queries is better than running more queries.

Fewer features means less complexity.

Fewer libraries means less complexity.

Fewer tools means less complexity.

Complexity costs time.

Complexity costs money.

Doing nothing is better than doing something useless.

How To Create A New Composer PHP Package

  1. git init demo-composer-package
  2. cd demo-composer-package
  3. composer init
  4. composer install
  5. composer validate
  6. Follow the guide for your php version

Instructional Video Table of Contents (YouTube)

Today I found this link to the  YouTube Iframe API Reference.  I find this interesting because I think that adding something like a table of contents to a video could be super helpful when if you want to reference the video. For example with instructional videos, a table of contents could provide an overview of video segments you might be interested in. It would let you quickly jump around instead of manually searching the video to find the point that you are interested in.
I used to go to user group meetings to find out the latest and greatest in programming and software development.  I could see this API being used after the video is filmed and adding click points.  I always want to tell friends about something that I learned at a presentation, and with the content links I could share the exact point where I liked the content.
I can imagine if video place markers were sharable then we might have metrics where we can see what points of a video are getting the most interest and shares.

How to use a extension with chrome and selenium-webdriver

Get the extension

I thought this would be the easy part. Turns out that the new chrome web store only lets you install directly to chrome.


Create And Use a profile

  • After you download your crx file put it in the same repo as your test. Next create a chrome profile and use the add_extension method.
      profile =
      profile.add_extension(File.dirname(__FILE__) +"/chrome_extensions/adblock/AdBlock_v2.5.61.crx")
  • Now you can use the new profile to with a driver
      Selenium::WebDriver.for(:chrome,:profile => profile)

Trouble Shooting

  • be sure that your chromedriver is updated. I used 26.0.1383.0
  • chrome  26.0.1410.43
  • selenium-webdriver  2.31.0

Creative Inspiring Motivator

Recently my team at HomeAway got personal profiles done from It was quite a fun process. Under their categorization, I am a Creative Inspiring Motivator.  This is what came back as my key strengths:

  • Outwardly directed energy ensures a fast friendly pace.
  • Creative thinker and dynamic innovator.
  • A natural entrepreneur, inquisitive and adaptable.
  • Builds relationships quickly and effectively.
  • Able to see the larger picture.
  • Takes advantage of opportunities.
  • Ability to see options and alternatives.
  • A visionary generating infectious enthusiasm.
  • Able to turn vision into a reality.
  • Enjoys having lots of harmonious relationships.

Today I met Matz. The creator of Ruby.

This is might not be a big deal for others who have been going to the lone star ruby conference for a while, but I got to finally hear Matz today.

I snapped a quick picture along with two of my team members from HomeAway. I am the guy on the right.

Matz used his keynote to talk about features to come in the next version of ruby such as  scoped monkey patching, module prepending, lazy mapping, and ruby keyword arguments.

He also mentioned mruby, that is coming soon.  I checked out the source and ran the tests. Here is the source link

download the source and run ‘make’ and ‘make test’.  You will then find mruby, mirb in the bin directory.

James,Alan, and myself with Matz.


Managing browsers from the command line on OS X

Have you ever wanted to open a url from the command line on OS X?  Turns out open can do many cool things like that.

open -a ‘google chrome’ ‘’

open -a

Sometimes a parallel Selenium run might get out of control and you need to close all your browsers, try this one from the command line:

killall firefox

Yes, I know killall is a very old Unix command, but I didn’t know that I could pass it an application name that a OS X has bound to an executable.

killall firefox-bin
killall firefox

I like the -a and -e options for open.

Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b ] [-a ] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.

Minesweeper Programming Contest. Using Selenium Web Driver to win Minesweeper

I had a great time attending the Test Automation Bazaar  in Austin. Alister Scott put on a contest to see who could write a program to win Minesweeper.  After checking out what was required, I started coding the Minesweeper robot. Before I noticed, I had spent hours coding tests and methods for the robot.  It was one of the most addictive and exciting code I had written.  I spent about 3 days coding along to get something to win on basic and intermediate level. I spent hours trying to win on advanced.

I ended up winning the Minesweeper Challenge!  I encourage everyone to take a look at Alister’s code.  Alister wrote some of the  best cukes and examples I have seen.  I was very impressed by the time he put into writing unit tests that work on logic only, taking the browser out of the mix.  Thanks Alister for putting on the contest.  If you wish to see what 3 days of coding gets you in a mine sweeper robot you can checkout my code on github.  As I mentioned before I got really engaged with writing this code.  I could have spent weeks tuning and polishing it.  I did have a chance to refractor the code to use Nokogiri instead of the find all elements selenium method to check the game state.  I believe that this might have actually slowed it down.

Sadly to say, I had to withdraw from polishing and tuning the code.  If you want to run my robot checkout the code and run the test “Minesweeper should win” in this file.


What does the SeleniumFury generator find on a page for you?

What should you expect SeleniumFury to find on a page for you?   Take a look behind the curtains at the PageParser class on git hub.
You will find that I am using Nokogiri xml parser to find elements and you will see this list of html elements that I am looking for.

          @nokogiri_selectors= ["select",

The only fields that are found are simple HTML fields.

For more complex UI elements like jquery select menus, I usually will define the class and write a unit test for the actions that can be done on the component.
You can use the page method on PageObject to define a subpage or page component like this.

class SelectMenu < PageObject     #This could be a jquery select menu     element :select_menu, {:id => "selectSomething"}
    def select index
      #code to select
class SearchPage < PageObject
     #add the component to your main page
     page :select_menu, SelectMenu
#Use your page component

I have more examples of this in the SeleniumFury source. See this PageObject Unit Test(spec)