O2 Script to perform a google search
See also this EtherPad session (http://ietherpad.com/UYmog5ljkj) for a walk-through of how this script was developed
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("<a href="http://www.google.com">http://www.google.com</a>"); searchText = searchText.line(); 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("OWASP Summit"); clickOnLink("Summit 2011 - OWASP"); return "all done"; //O2File:WatiN_IE_ExtensionMethods.cs //using O2.XRules.Database.Utils.O2 //O2Ref:WatiN.Core.1x.dll
[…] Dinis blogs about it on his blog. https://o2platform.wordpress.com/2010/12/04/o2-script-to-perform-a-google-search/ […]
Pingback by Etherpad 02 scripting to search and click on a link in Google « parsonsisconsulting | December 4, 2010 |