Skip to content

Instantly share code, notes, and snippets.

@dapngn
Last active December 20, 2015 06:28
Show Gist options
  • Save dapngn/6085522 to your computer and use it in GitHub Desktop.
Save dapngn/6085522 to your computer and use it in GitHub Desktop.
This C# does not need to be compiled into a .dll, it's a .csx file that is compiled at runtime by the Roslyn api. The expression lambda is populated by Selenium webdriver code.
ExpectedResult = true;
ScriptResult = (new WebInteraction(
WithBrowser: WebInteraction.FireFox,
Script: (w) =>
{
// Selenium webdriver code
w.Driver.Navigate().GoToUrl("https://duckduckgo.com/");
w.Wait
.Until(p => p.FindElement(By.Name("q")));
w.Driver
.FindElement(By.Name("q"))
.SendKeys("I don't wanna be a playa no mo");
w.Result = true;
}))
.Execute()
.Result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment