Page Navigation
|
|
Visit a url
|
go("google")
|
|
Load url in a hidden window
|
w = fetch("yahoo")
|
|
Opens url in a new tab
|
openTab("www.mit.edu")
|
Forms & Links
|
|
Click on a button or link
|
click("feeling lucky")
click("FAQ")
|
|
Enter a value into a textbox
|
enter("chickenfoot")
enter("from address", "77 mass ave")
|
|
Check or uncheck a checkbox
|
check("arabic")
uncheck("arabic")
|
|
Pick from a listbox or drop-down
|
pick("GIF")
pick("file format", "any")
|
Pattern Matching
|
|
Find a pattern
|
m = find("google search button")
|
|
Count matches
|
m.count
|
|
Get visible text
|
m.text
|
|
Get HTML source
|
m.html
|
|
Get Node object
|
m.element
|
|
Iterate over matches
|
for (m = find(pattern);
m.hasMatch;
m = m.next) {
...
}
|
Page Modification
|
|
Insert html into page
|
insert(before("textbox"), "Search: ")
insert(after("textbox"), "...")
|
|
Remove html from page
|
remove("advanced search link")
|
|
Replace html
|
replace("first image",
"<img src='mylogo.jpg'>")
|
Widgets and Interaction
|
|
Make a link or button that fires action when clicked
|
new Link("Go to Google",
"go('google')")
new Button("Green", function() {
document.body.style.background = "green"
} )
|