Sunday, January 29, 2012

Web Form Automation with Selenium WebDriver

Have you ever had a tedious task involving a web site form that you have wanted to automate, but couldn't? Or perhaps you wanted to automatically test a website you were making? Well, there's a fairly well-known tool for browser automation called Selenium. I'd heard of it before, and was looking into it when I had a project where I want to take some JavaScript based pages, run them through a JavaScript engine so they could generate the HTML I needed and then save the results. But until now, I had never had a chance to use it. It's powerful, and there's a lot you can do with it that I won't cover. But the basics will get you a long way.

More after the break.

Saturday, January 21, 2012

Composing Emails and Sharing Files in MonoTouch

Lately, I had to add the ability to import and export data from a MonoTouch application via email. Thanks to everything you get in the iOS SDK for free, this is actually relatively easy. But you do need to know all the places you need to touch to make this happen. You'll need to:

  • Modify your info.plist to specify the file types your application supports
  • Update your application delegate to override the HandleOpenUrl method
  • Update your view controller to show a mail composer
  • Add code to your view controller to import a file that is passed to it and display it

Many thanks to this this tutorial on email sharing to get me going on this.

Details after the break.

Sunday, January 15, 2012

Bash Basics

I've been doing a lot of bash scripting lately.  I haven't really done any bash scripting since, oh, 2007 or so, and nothing to complicated even then, so it's been an interesting learning / remembering experience for me.  Hopefully writing it down this time will make it easier next time.  Here's a preview of what you'll find here:

  • Defining and using variables
  • Variable and arithmetic expansions
  • Arrays
  • If statements
  • While loops
  • For loops
  • Input redirection, output redirection, and pipes
  • Regex tools: grep, sed
  • Command substitution
  • Useful commands