Browser Automation - NTC 2010

Embed Size (px)

Citation preview

PowerPoint Presentation

Browser Automation

@ehrenfoss | 512-673-7254 | http://www.preludeinteractive.comUsing The Internet is an Skill to be Feared and Respected Like Competitive Eating but More Useful Professionally

Hi there and welcome to this session - we're going to be talking about browser automation, which is the term I chose to cover a number of things you can do to use your browser faster and more effectively.

[NTC stuff]I'm Ehren Foss, I run a small firm in Austin called Prelude Interactive. We do database and web application stuff for nonprofits. This is my second/third session ever so please don't heckle or I might cry.

Overview

Why Browser Automation?

Shortcuts, Quickness, and Ubiquity with the Keyboard

Self Control with LeechBlock, RescueTime, and your hosts file.

Macros with iMacros

Fin.

Someone told me that people learn better if you tell them what you're about to tell them, then tell them, then tell them what you told them. So, this is what you're about to hear.

Why Browser Automation? Everybody who works in an office spends a lot of time on the computer, probably too much. Of the time spent on the computer, a huge portion goes to using webpages through a web browser.So, how to get better and badder at that? First, I'll get on my high horse about how much better it can be to use the keyboard for things than a mouse, and as a part of that we'll talk about ways to avoid reaching for the mouse to do things fast.Next, and this may seem like a weird one at first, we'll talk about ways to selectively break the internet in order to get more done. That's right, I'm talking about shutting off TMZ, Cute Overload, Gawker, Facebook, Twitter, and everywhere else we waste time or procrastinate. Finally, macros - - are ways to record and play back what you do. If you do the same thing or similar things over and over again, this can come in handy. Im talking about enabling 100 volunteers profiles, logging in to a system you dont use often and navigating to a particular report over and over again, maybe setting up fun run profiles for all 300 cities or something.One last thing - I don't want to come across as a FireFox zealot just because most of the examples use it. FireFox is a good browser, and it has really forced the others to innovate and offer a lot of the same things. So, switch to FireFox or be patient, or do some research.

Why Browser Automation?

Because you use it all the time!

More and more web apps, fewer desktop apps

Eventually, Browser == Computer

Keyboard Vs. Mouse

Moving the mouse is a motor skills problem in 2 dimensions.

Moving the mouse requires moving your hand a lot. Keys require smaller, quicker movements.

3 keystrokes = 185k combinations on a small keyboard

Mobile interfaces are too small and our fingers are too big.

Touch screens are too new (and we'retoo clumsy)

So, philosophically, when I started writing this I was firmly in the camp of "keyboard is faster." I'm still there. But, don't slavishly follow that advice.

The fastest thing is a keyboard. Keys are binary - you don't have to aim them, smudge them, and you can tell the computer more than a hundred things a minute with them. We are years away from doing this with other interfaces, like touch screens or voice. The only thing that comes close, strangely enough are screen readers for the vision impaired, though a poorly designed webpage or piece of software can really ruin the experience.

It's true that mouse coordination is tough - just ask the folks who are usually in here. It's not only a 2d targeting problem, it requires translating from the plane on your screen to the one on your desk.

On the other hand

Weve done a cool $50 million of R & D on the Apple Human Interface. We discovered, among other things, two pertinent facts: Test subjects consistently report that keyboarding is faster than mousing.

The stopwatch consistently proves mousing is faster than keyboarding.

This contradiction between user-experience and reality apparently forms the basis for many user/developers belief that the keyboard is faster.

- Bruce Tog Tognazzini

http://www.asktog.com/TOI/toi06KeyboardVMouse1.htmlhttp://www.codinghorror.com/blog/archives/001088.htmlhttp://www.codinghorror.com/blog/archives/000825.html

http://www.youtube.com/watch?v=1MPJZ6M52dIhttp://www.ted.com/talks/pattie_maes_demos_the_sixth_sense.html

Jeff Atwood of "Coding Horror" has a very wise take on the issue. I agree with his conclusion that things you do a LOT should be done with the keyboard. And, if you're brave, resist the easy thing and learn one new keyboard shortcut per day or per week.

I may never get to the point where I can completely unplug my mouse - webpages in particular can be difficult to navigate - but I WANT to.

It's possible that someday we'll be controlling screenless, projected three dimensional interfaces with twitches of our eyebrows and small lip movements along with hand gestures, but I think it's safe to say that when that happens we'll use the new technology just as poorly as we do the keyboard and mouse.

A friend of mine, and in fact, my first boss, recorded his keystrokes for a month and then used a program to remap his keyboard so it would be more efficient for the kind of programming work he was doing. It got him about 10-20% faster and he was able to retain QWERTY skill too. Don't worry, I'm not saying this is a reasonable thing for everyone. Just saying there are people out there pushing the bleeding edge of exploration now that we've found all the continents and planets and stuff.

So, it turns out that the pet project of frustrated typesetters and mechanics in 1873 and Douglas Engelbart's prototype from 1964 form the backbone of your computer experience.

Browser Shortcuts and "Hotkeys"

Cntl-T - new tabCntl-Tab - switch tabs.Cntl-L - go to a websiteCntl-W - close the tab I'm on.Cntl-K - search

Check out the hints in your menus too! Like...Alt-Fthen Alt-F-V

/ search for links - See a link? Zing to it.

http://support.mozilla.com/en-US/kb/Keyboard+shortcuts

A shortcut is general, but a hotkey is some key sequencethat the builders of software have prepared to do something useful. Some of them access menus, some of them execute very common actions, and others can be defined by the users themselves.

With the FireFox browser - not every browser is the same, but they are similar, and easy to look up - we can do....

..

So, I use those a lot. Theyre very handy for any web browser user, and there are only five things to remember. And if youre already a home-row typist, those keys arent very far away.

Another thing to look at are the hints that your menus give you a lot of times. Notice that Alt-F opens up the File menu, but F, E, V, and the S of history and the L of delicious are also underlined. This, in Windows anyway, is an indication that you can use Alt+ that letter to open that menu. If you want to access submenu items, like Print Preview, keep your hand on alt and press another letter.

Remember, Control and Alt are Shift are on both sides of the keyboard, although I havent used the ones on the right for years. Im left handed.

Two last things to show you on FireFox, you can use forward slash to quickly search for links in a page. So if I go to cuteoverload.com and see a link I want to navigate to right away slash, then there you go.

Lastly, if theres a reference site that you use for searching A LOT then its handy to find the searchbox and add a keyword search for it. What this means is that from then on , in your URL, you can type that word and then what youre searching for and voila. I use the wikipedia and php.net search boxes quite a bit.

FireFox Keyword Search

Right Click in a search box. "Add a Keyword for this search...Pick a term (e.g. wiki or php)Try it!

Gmail Hotkeys

? - see all hotkeys

k - newerj - oldern - next messagep - previous messageo/Enter - openx - select# - deletey - de-label or archive

http://mail.google.com/support/bin/answer.py?hl=en&answer=6594

Not going to spend much time on these because not everybody uses Gmail, but the lesson you should take is that pretty much every webmail client, or big very popular piece of software, also has hotkeys built in its not just the browser.

Look them up!

There are more but these are enough for me.

Ubiquity

Do common multi-step tasks fasterWikipediaFacebookWeatherCalculator

Search for new extensions for the websites you work with.

Control + Space

https://mozillalabs.com/ubiquity/

Ubiquity is a FireFox extension that basically consolidates and exposes a bunch of shortcuts and hotkeys to you that would be difficult to do otherwise.

Rather than searching for Austin's weather the normal way...

I can Cntl-T, Cntl-K it... which isn't much faster.

I can also Cntl-Space it

People can build new extensions for Ubiquity, just like FireFox allows people to build new extensions like Ubiquity, so you never know, there might be some out there for your favorite website.

That concludes our section on hotkeys, the keyboard, and a little about a browser extension called ubiquity. Remember to search for the name of the program youre using along with hotkeys, and remember do try something new every day and try to learn a new hotkey every week. Before long youll be melting keyboards all over the place..

Self Control

Corporations and orgs that lock down the internet for everyone get a lot of bad press, and I think they deserve it. But, I think most people also deserve some bad press because theyre hurting themselves and their orgs by wasting too much time on the internet.

Do you really enjoy surfing the web aimlessly? Do you? Is it better than getting your work done and just going outside? This section aims to help you do just that.
Thanks Pogo. You were right.

C'mon... be honest....

How to find out whats really going on

Videotape yourself.

Take screenshots.

Set a timer

Rescue Time

http://www.rescuetime.com/

A lot of people believe they are very productive and that they only waste a little bit of time. Also, eighty percent of people believe they are in the top 20% of drivers. Denial isn't just a river in egypt, people.

The best thing to do is monitor yourself somehow. It's best if that monitoring is not under your control.

So, set up some software to record your desktop, or use an actual video camera to do it.

Set an egg timer to go off 10 minutes later and see if you're actually working when it goes off and what you got done in the 10 minutes. Make sure it doesn't tick that gives me the willies. If you're really curious to see where your time goes every day, check out RescueTime. It's a program that will track what you're doing on your computer and how long you do it.

Go ahead and estimate how much or your day you actually spend working and then turn on Rescue Time.

You'll probably be a little mad.

I originally turned it off because it was depressing.

Self Control, Step 1

Aww!http://www.youtube.com/watch?v=bYTwmkvFuH4
Block Sites in your Browser: LeechBlock (FFox) Allowed Sites (IE) Right click - Block Content (Opera)

Once youve identified the problem which is all of us do something about it. The deck is not stacked in our favor. Interruptions, flashing things, multitasking, being able to access the entire corpus of videos of kittens pouncing on things at a keystroke... it's hard.

When I'm confronting something difficult before I know it I've Control Tabbed my way into a youtube video of a baby goat surprised by a sneezing pig. Lets watch

So we need help.Clearly if you can't get to a website it's harder, though not impossible, to waste time on it. So, most browsers offer a way to shut off certain sites some are framed like parental controls, some are more flexible.

[ demo leechblock ]

In FireFox, the LeechBLock extension will help you. You can set up different sets of sites, different times they're allowed, and a different redirect for each set.

The Nuclear Option

The 'hosts' file is a file on most operating systems where you can match URLs to IPs - like a local DNS.

Set to 127.0.0.1 (your computer) to disable the website completely:

127.0.0.1 icanhascheezburger.com

/etc/hosts/c:\windows\system32\drivers\etc\hosts

http://practice.chatserve.com/hosts.html

I call this the nuclear option because once you do this there's no way to reach this website on your computer at all on any browser until you undo it and its cumbersome to do and undo.

The hosts file is a file where you can set up special rules for associating domains with IPs. This is "DNS" - the system that helps the internet know that when you type in http://whitehouse.gov it should request the webpage from 173.203.198.116. Simple, right?

Don't sorry, it's not that complicated. All we do here is tell your computer to look to itself for certain domains. Naturally, unless you happen to host something like failblog.com on your computer, your computer won't respond.

"your computer" calls itself "localhost" or more precisely 127.0.0.1. So just add a line like this to your hosts file and voila!

[example]

On unix based computers (including Apple) the file is in /etc/hosts/. On Windows, it's the longer one on screen.

The link at the bottom has a good guide to all this.

You can even set up a special page to be extra mean and suggest alternatives.

Macros

Wellthey are neat.

Ah, finally, the good stuff. So youve learned about your keyboard, youve gotten familiar with hotkeys, and youve shut off certain sites with leechblock, and you are ALWAYS VIGILANT with leechblock.

Youre a pro.

So, lets check out the next level, shall we?

Browser Macros?

iMacrosCorny website, useful tool: Free Version works Just Fine

http://www.iopus.com/imacros/

Available for multiple browsers

Selenium Open Source Website Testing

http://seleniumhq.org/

So, macros are abbreviated computer instructions, but more usefully, they are things that you can record and play back. A number of tools allow you to do that. There are a bunch of programming tools, but gosh, who wants to be one of those, right? Excel does them too if you use Excel a lot.

There are two I have found for web browsers with a user interface that isn't terrible.

iMacros has a totally cheesy website, but... stick with me. They have a free version that I use, or they have a licensed version if you need to do heavier duty stuff, which you probably don't.

Selenium is a product of the Open QA movement, and is designed more for automating browser testing. You can still use it for macros though.

Simple Stuff

Keep track of loginsNavigate Deeply Pay a Bill- Difficult to Remember/Find Login?- Hard to Navigate Website?Startup and Setup

Macros are like hotkeys or shortcuts on steroids.

First, I'm going to demo my favorite and simplest use of iMacros. Keeping track of SalesForce logins!

If you work with SalesForce or any other platform with a bunch of clients or users you have access to, it's easy to lose track of all the logins because your browser typically only remembers one for you.

iMacros to the rescue! I can log in to Development

Sandbox

or Production

and even into the separate 'Customer Portal' instances.

All by double clicking. I also use it to 'build a package' - which is just a SalesForce term for something I do about every two weeks and each time I forget which options to choose. So, I recorded them.

This next example is a little staged because I could easily set up an automatic payment through my bank. But, I like noticing when I pay my utility bill and recording the amount of electricity, water, and whatnot that we use.

This macro combines the login with a few other clicks to accomplish paying my bill in seconds. Texas Gas Service used to require - I kid you not - an 18 digit account number for login. Thanks to matriculating roommates I had three written down and could never remember which one.

Finally, it you want to get yourself into a regular habit each morning or after lunch, you can open up a bunch of websites at once, and go to the right place in those websites to get right into it.

Stuff that Used to Take You Hours

Rolling something out and need to create 600 users?Preparing for a 10k race in 273 cities and need to create each group, folder, email template, etc?

iMacros + CSV = LOVE

iMacros: Extra Credit

Setup shortcuts to individual macrosSchedule tasks

http://wiki.imacros.net/Tutorials

It is a little like programming. Don't be scared!

So, if you end up getting really into Macros, you can do other stuff like seting up shortcuts to the iMacros... see how we're tying all that together?

You can also schedule the macro as a task. Scheduled tasks are pretty good for stuff you do on a regular... schedule. Like download a report, or approve someone's timesheet.

Internet ExplorerFireFoxChromeSafariOperaExtensions?YesYesYesYesYesMacrosiMacrosiMacrosiMacrosAppleScriptOpera MacrosSelf ControlApproved Sites / Hosts FileLeechBlockNope!Parental Controls - Allow ListBlock ContentConvenienceIE8 Web Slices?UbiquityNope!QuickSilver??HotkeysYesYesYesYesYes

So, one of the slides I'm going to leave you with is a little chart showing the important features we covered and what they're called or whether they're available in each browser.

Overview

@ehrenfoss | 512-673-7254 | http://www.preludeinteractive.com

First, I'm Going To Read This SlideWhy Browser Automation?

Shortcuts, Quickness with Ubiquity (Keyboards!!)

Self Control with LeechBlock, RescueTime, and your hosts file.

Macros with iMacros and Selenium

Finally, I'm Going to Re-Read This Slide

Look familiar?

I already read this slide.

You learned that browser automation is important because you spend a lot of time there. And time is valuable.

We saw some shortcuts, checked out ubiquity.

We learned that we are our own worst enemy and how to be more of our best friend. You saw RescueTime, so check that out.

You also saw how to execute the nuclear option and edit your hosts file.

Lastly, I bored you to death with iMacros (don't forget Selenium) and showed you how to do repetitive stuff real easy.

That's it!

Evaluation Code: 159
How Was this Session?

Call InTextOnlineCall 404.939.4909Enter Code 159 Text 159to 69866Visit nten.org/ntc-evalEnter Code 159

Session feedback powered by:Tell Us and You Could Win a Free 2011 NTC Registration!