parsonsisconsulting

Parsons Software Security Consulting Blog

Etherpad 02 scripting to search and click on a link in Google

leave a comment »

I was on an Etherpad session with Dinis and Sarah from OWASP.   Below is the link to Etherpad.   Etherpad is a great tool for programmers and for us to help write scripts together and trouble shoot.

http://ietherpad.com/

We used the free version.

Below are our Etherpad sessions from December, 3, 2010.

http://ietherpad.com/xkckfhJGAY

http://ietherpad.com/UYmog5ljkj

Dinis blogs about it on his blog.   http://o2platform.wordpress.com/2010/12/04/o2-script-to-perform-a-google-search/

Below is today’s 02 script.  Dinis is the original author but I tweaked it to do some shameless self promoting.


panel.clear();
var ie = panel.add_IE().silent(true);
ie.disableFlashing(); // use this when developing the script to make it faster
Action<string> searchGoogle =
 (searchText)=> {
 ie.open("http://www.google.com");
 searchText = searchText.line();       // here......  <----
 ie.field("Search").value(searchText).flash();
 ie.button("Google Search").Click();
 };
Action<string> clickOnLink =
 (linkToClick)=> {
 if (ie.hasLink(linkToClick))
 ie.link(linkToClick).flash().click();
 else
 "Error: could not find link: {0}".error(linkToClick);
 };

searchGoogle("Parsons Software Security Consulting, LLC");
clickOnLink("Parsons Software Security Consulting, LLC - Home");


return ie.link("Parsons Software Security Consulting, LLC - Home").click();




//O2File:WatiN_IE_ExtensionMethods.cs
//using O2.XRules.Database.Utils.O2
//O2Ref:WatiN.Core.1x.dll


This code opens Google.  Disables flashing to make the search faster.  Then searches for my company, Parsons Software Security Consulting, LLC and clicks on the first link then opening my company’s website.

There is the script. Feel free to email me at mparsons1980@gmail.com for comments.

Matt Parsons, CISSP, MSM,
Parsons Software Security Consulting, LLC
Securing the Internet one Application at a time.

Written by mparsons1980

December 4, 2010 at 4:05 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: