Created
November 11, 2010 05:01
-
-
Save dcrosby42/672034 to your computer and use it in GitHub Desktop.
Extension method for WatiN.Core.Browser, utilizes in-page JS function WatinSearchHelper.getElementId()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using WatiN.Core; | |
namespace WatinSearchHelper | |
{ | |
public static class BrowserExtensions | |
{ | |
public static Element FindViaJQuery(this Browser browser, string cssSelector) | |
{ | |
var elementId = browser.Eval(string.Format("WatinSearchHelper.getElementId(\"{0}\")", cssSelector)); | |
return browser.Element(Find.ById(elementId)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment