Click here to Skip to main content
13,399,140 members (33,540 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 6 Jan 2006

Automate user actions in a web page - Microsoft Windows Workflow Foundation

Rate this:
Please Sign up or sign in to vote.
This article illustrates WWF custom activities to simulate user action and populate web page input fields and submit the page.


During Christmas holidays, I read about Microsoft Windows Workflow Foundation (WWF) for the first time and realized that I was too late in learning this new technology. "Better late than never" - so I decided to get my hands wet on this framework. WWF is an extensible framework from Microsoft to implement workflow based solutions. In simple terms, a workflow is a collection of activities. To read more on WWF, please visit the MSDN site.

At least once in a day, all of us open a web browser to do some search in Google, open our email account to check emails, and so on. This is an example of a human workflow, and in this article, I am going to show how to express this workflow in WWF.

Activities Defined

For doing a Google search, one has to perform the following activities:

  1. Open the browser.
  2. Navigate to the Google site.
  3. Enter the search text.
  4. Press the Search button.

For checking emails in a Hotmail account, one has to perform the following activities:

  1. Open the browser.
  2. Enter the username.
  3. Enter the password.
  4. Press the Sign In button.

In the above scenarios, we are filling a form in a web page and posting it. To accomplish this workflow, I did a very minimal abstraction and came up with the three activities below:

  • VisitPage - Opens the browser and navigates to the specified website.
  • InputData - Fills up the input controls on the webpage with the specified values (supports textbox, textarea, radio button, checkbox, dropdownlist).
  • Click - Posts the form by pressing the specified button

Custom Activity

Microsoft has made WWF application development very easy by providing the Visual Studio® 2005 Extensions for WWF. A separate project template is available for developing the Activity library. To implement a custom activity, all we have to do is derive from the Activity class and override the Execute method.

public class MyActivity : Activity 
    protected override Status 
              Execute(ActivityExecutionContext context) 

I added additional properties for the VisitPage, InputData, and Click activities. See the attached code for details.

Defining a Workflow

Visual Studio has full designer support to model a workflow and even allows us to define breakpoints in the designer itself for debugging. Workflows can be defined in XML format also (XOML - XML workflow markup). Figure 1 is Hotmail account login workflow in designer view, and figure 2 is a Google search workflow in text view.

Figure 4 - Hotmail Login

Figure 5 - Google Search


There are so many automated web filing systems available today for a variety of services. I am sure that they are proprietary solutions very hard to develop, maintain, and to train new people. Now, we have got a very good generic, extensible framework from Microsoft with a full suite of developer tools to develop workflow based solutions. With the designer support, even a business analyst can complete a workflow without any help from a developer. I strongly believe that re-engineering web filing systems using WWF will deliver true ROIs.

Developer Info

The sample application was developed using Microsoft Pre-Release Software WinFX Runtime Components - December Community Technology Preview (CTP). Microsoft internet controls were used for the IE browser functionalities.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Karthikeyan Arunachalam
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralRoot Activity Type Invalid Error Pin
cfernald4-Mar-09 10:51
membercfernald4-Mar-09 10:51 
Questionnot able to reach the Execute method of custom activity Pin
amitkm1-Oct-07 16:39
memberamitkm1-Oct-07 16:39 
GeneralGetting errors. Pin
jdkulkarni13-Feb-07 22:58
memberjdkulkarni13-Feb-07 22:58 
GeneralSimplier is definately better! Pin
.NETWannabe11-Aug-06 12:01
member.NETWannabe11-Aug-06 12:01 
GeneralRe: Simplier is definately better! Pin
GaoYu200013-Aug-07 18:00
memberGaoYu200013-Aug-07 18:00 
QuestionUIFlow [modified] Pin
saisrio26-Jun-06 4:13
membersaisrio26-Jun-06 4:13 
GeneralA concrete example would be nice Pin
sytelus8-Jan-06 0:20
membersytelus8-Jan-06 0:20 
GeneralRe: A concrete example would be nice Pin
Karthikeyan Arunachalam8-Jan-06 2:30
memberKarthikeyan Arunachalam8-Jan-06 2:30 
GeneralRe: A concrete example would be nice Pin
ernest_elias10-Jan-06 21:59
memberernest_elias10-Jan-06 21:59 
GeneralYou are not very late Pin
Igor Vigdorchik6-Jan-06 16:13
memberIgor Vigdorchik6-Jan-06 16:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180218.2 | Last Updated 6 Jan 2006
Article Copyright 2006 by Karthikeyan Arunachalam
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid