AutoWebClick
AutoWebClick 1.1 - freeware (build date: 01.04.2012)
AutoWebClick is application for automatization of web user interaction by executing specified set of commands from the script.
Application can be used to programmatically perform some common tasks. Example is to turn off/on wireless network by using web interface of the WLAN router (see gigaset_sx763_wlan_off.txt).
Download:
- Free download of AutoWebClick 1.0 setup (WIN32 build)
- C++ source code (solution coded in Visual 2008 sp1 + Qt 4.8.0 framework)
Bug Fixes and Changes (from 1.0):
- Setup was invalid)
- build with new QT 4.8
Script format:
Commands are stored in script and executed sequentially. Script is in the plain text format with new line as delimiter between commands. Each command is consist of two parts: command and value delimited by TAB.
List of all supported commands:
LOAD_ABSOLUTE_URL - loads URL, e.g. "LOAD_ABSOLUTE_URL http://192.168.200.1" loads web page located at 192.168.200.1
LOAD_RELATIVE_URL - loads relative URL, e.g. home.html
FORM_FLD_FIND - finds element with CSS selector style query string, e.g. "FORM_FLD_FIND input[name='Login']" will find first input field with attribute name='Login', more attributes can be searched. E.g. input[name='wire'][value = '0'] will find first element with attribute name and value set to values specified. See details on CSS selector syntax http://www.w3.org/TR/CSS2/selector.html
FORM_FLD_SET_VALUE - sets attribute named 'value' with given value on the previously founded element (with FORM_FLD_FIND command). Commonly used to 'enter' passwords or similar, e.g. FORM_FLD_SET_VALUE my_pass will enter my_pass password into field
FORM_FLD_SET_ATTR - sets the attribute on the previously founded element. Command value is consist of name and value part delimited by '=' e.g. FORM_FLD_SET_ATTR name=wire will set previously fined element attribute 'name' to value 'wire'
FORM_FLD_EXE_JAVA_SCRIPT - executes javascript within previously founded element context (this-> will point to the previously founded element). Next command is executed right after.
FORM_FLD_EXE_JAVA_SCRIPT_WAIT_FOR_LOAD_URL - executes javascript within previously founded element context (this-> will point to the previously founded element). Wait for load means that command will probably trigger URL change and program will wait for new page to load before executing next command. Commonly used to emulate click on submit button, e.g. this.click()
FORM_FLD_EXE_JAVA_SCRIPT_IGNORE_LOAD_URL_ERR - executes javascript within previously founded element context (this-> will point to the previously founded element). Wait for load means that command will probably trigger URL change and program will wait for new page to load before executing next command. Error on page load will be ignored. Commonly used to emulate click on button,e.g. this.click()
FORM_FLD_EXE_JAVA_SCRIPT_FORCE_EXIT - executes javascript within previously founded element context (this-> will point to the previously founded element). Command will wait 2 seconds after javascript command is issued then it will terminate execution of script.
WAIT 2000 - waits for specified time in miliseconds. Sometimes needed for some pages to load correctly. Wait 0 is also allowed.
Note: anchor element will not be activated by 'this.click()' javascript command. Use LOAD_RELATIVE_URL or use more complicated javascript to activate link.
Example: activate url link within web page with href='advanced.html':
//find element
FORM_FLD_FIND "a[href='advanced.html']
//set id of the element to 'advanced_link'
FORM_FLD_SET_ATTR id=advanced_link
//execute javascript code for creating mousedown event and execute it:
FORM_FLD_EXE_JAVA_SCRIPT_WAIT_FOR_LOAD_URL
var evt = document.createEvent('MouseEvents'); evt.initEvent('mousedown', true,true); document.getElementById('advanced_link').dispatchEvent(evt);
Note: javascript code is value of command and must not contain new line.
Example scripts:
gigaset_sx763_wlan_off.txt - used to turn off WLAN on ADSL-WLAN router Siemens Gigaset SX763
gigaset_sx763_wlan_on.txt - used to turn on WLAN on ADSL-WLAN router Siemens Gigaset SX763
Command line support;
Script can be executed from command line by starting application with -execute "path to the script" parameters. E.g. AutoWebClick -execute gigaset_sx763_wlan_off.txt
License:
Utility is freeware. Source code is copyleft although i'll appreciate if you at least mention my site: mandrilo.com if you are using any part of code. Thanks.

