tags:

views:

278

answers:

10

At my company, we have to fill out a daily timecard, and I want to automate it. I want to use some sort of tool that will allow me to write something like this:

Launch Firefox
go to www.xxxx.com/timecard
Wait for page load complete
In UserName box: put username
In Password box: put password 
Press enter

Wait for page load complete

if login failed
   email [email protected] that unable to automatically do timecard, please check password
   return;

Get today's date

if today is Saturday or Sunday
  close firefox
  return;


find the timecard column that matches today's date
find the row with the right charge number
put in 8.0 hours
click "Save" link
close firefox
return;

It would be really nice if the software solution will also execute itself daily at a given time.

+1  A: 

For decision making, you might have to write some code.

iMacros for firefox has the ability to record/playback.

shahkalpesh
+2  A: 

Check out the Chickenfoot extension for Firefox. I believe it may help you a long the way.

Chickenfoot is a Firefox extension that puts a programming environment in the browser's sidebar so you can write scripts to manipulate web pages and automate web browsing.

It also provides a basic record feature, and you can then fine-tune the interactiosn with the web page(s).

Lloyd Cotten
+1  A: 

I have not used it myself but I have heard good things about Selenium. This is a Web UI testing tool that can be scripted in a number of different languages.

Steve Weet
+1  A: 

If all you need to automatize is related to browsers, then you may try out Selenium Remote Control which provides libraries in different languages.

For browser automation, there are a couple more experimental libraries in javascript (you should search for web app testing tools as these are imo your best bet for now)

./alex

alexpopescu
A: 

If by "some sort of tool" do you mean something like a programming language or environment that will allow you to automate what FireFox does? If so, I recommend learning how to write a FireFox extension. Extensions are written in Javascript. See https://developer.mozilla.org/en/Extensions

--
bmb

bmb
A: 

You could use selenium or watin on a simple .net console program. Then configure a task on window to call it at a given time of day.

eglasius
+2  A: 

Since you are asking about UI automation you might want to check out AutoHotKey.

It's a macro language and you can compile the code into executable binaries (.exe).

However, sending web request could be done better without a browser by sending the necessary HTTP requests. Such an approach is more light-weight, more flexible and probably easier to maintain as well.

0xA3
A: 

If you are using Linux you could easily do this with a bash script of some kind. Have a look at the CURL library.http://curl.haxx.se/. You could then schedule the script to run with cron.

This is why I love Linux, the above is simple to do. I windows I suppose you could use the windows shell. I think the curl library runs on windows.

Peter Osborne
A: 

Selenium (www.openqa.org) tools will work for you. Install the Selenium IDE and record the macro. The "code" is simple JavaScript/HTML.

Selenium RC provides a very strong solution for automated testing from a variety of languages and tools.

spdaly
+1  A: 

I would try to accomplish this with twill.

Anonymous