Skip to content

Instantly share code, notes, and snippets.

@DavidRogersDev
Created October 20, 2014 02:21
Show Gist options
  • Save DavidRogersDev/7c3b665e446a7d895649 to your computer and use it in GitHub Desktop.
Save DavidRogersDev/7c3b665e446a7d895649 to your computer and use it in GitHub Desktop.
Fun gist showing how to use my SeleniumCore library in F#.
open KesselRun.SeleniumCore
open KesselRun.SeleniumCore.Enums
open KesselRun.SeleniumCore.Infrastructure
open KesselRun.SeleniumCore.TestDrivers
open KesselRun.SeleniumCore.Infrastructure.Factories
[<EntryPoint>]
let main argv =
let mutable driverOptions = new DriverOptions()
driverOptions.DriverExePath <- @"E:\"
driverOptions.Port <- 6667
driverOptions.Url <- "http://sapln.ent.sirsidynix.net.au/client/charlessturt/"
let mutable factory = new TestDriverFactory(driverOptions)
let testDriver = factory.CreateTestDriver(DriverType.Chrome)
testDriver.GoToUrl(testDriver.DefaultUrl)
testDriver.FindByCssSelectorClick("#libInfoContainer > div.loginLink > a") |> ignore
let loginIFrame = testDriver.FindByTagName("iframe")
testDriver.SwitchToIFrame(loginIFrame) |> ignore
testDriver.TypeText(FinderStrategy.Id, "j_username", "SomeUserName") |> ignore
testDriver.TypeText(FinderStrategy.Id, "j_password", "SomePassword") |> ignore
testDriver.FindByIdClick("submit_0") |> ignore
testDriver.SwitchBackToDefault() |> ignore
0 // return an integer exit code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment