2 sheets tagged with "automation":

Command line email automation using Runworkbook

This spreadsheet illustrates the automation of tasks from the command line using Resolver One and the RunWorkbook function.
Such tasks could be run using the Windows Task Scheduler. This approach has advantages over automating a GUI interface since dialogs and other GUI interactions won't block the task but still allows you to use a GUI for development.

This workbook reads the current stocks of various items from a CSV file (which is representative of a database or webservice), works out if these are below given quantities and if so sends e-mails to a set of suppliers to buy replacements. When run from Resolver One itself a button press sends these emails.

However, a Python and batch file are included which run the spreadsheet using Runworkbook without starting Resolver One. This passes a paramater to the spreadsheet telling it to run in batch mode and therefore send the emails. This batch file can be run periodically by adding it to the Windows Task Scheduler <http://technet.microsoft.com/en-us/appcompat/aa906020.aspx>. The python and batch file are each only one or two lines in length. The seperate runworkbook.py file is somewhat larger: this is boilerplate code that can be shared between all tasks using this mechanism.

16 April 2009. Tagged with automation, commandLine, email, RunWorkbook

Resolver One and WatiN - Web page automation and testing

This is a simple example of how to use the new WatiN 2.0 library in Resolver One. WatiN can be used to automate testing of webpages in Internet Explorer, and version 2.0 has partial support for Google Chrome and Firefox.

You basically use WatiN to create a script of what you want to do on a webpage (ie: click, type, browse to...). This example takes a list of search terms and compares how many results are provided by Google, Bing, and Yahoo.

This is a simple task, but WatiN can be used for much more advanced automation on complex sites even including AJAX webpages. For a more complex example, see the link below for an IronPython script that downloads a list of incoming and outgoing call data from the Vonage website.

NOTE: if you are using Windows Vista with IE7, you will need to uncheck the "Enable Protected Mode" box for the Internet Zone on the Security tab of Internet Options before Watin will work. Otherwise, IE7 will open two windows (one blank, and one for Google) and then give a timeout error. Temporarily disabling Protection Mode and then restarting the browser will allow the sample to run. This error does not occur in IE8 or on Windows XP. See link below for more information.

30 June 2009. Tagged with automation, testing, WatiN

<< Resolver Exchange