Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More idiomatically F#. :) #143

Merged
merged 2 commits into from
Apr 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions canopy/canopy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,16 @@ let ( << ) cssSelector text =
try e.Clear() with ex -> ex |> ignore
e.SendKeys(text)

let atleastOneItemWritten = ref false
elements cssSelector
|> List.iter (fun elem ->
try
writeToElement elem
atleastOneItemWritten := true
with
| :? CanopyReadOnlyException as ex -> raise ex
| _ -> ())
!atleastOneItemWritten)
|> List.map (fun elem ->
try
writeToElement elem
true
with
| :? CanopyReadOnlyException as ex -> reraise()
| _ -> false)
|> List.exists (fun elem -> elem = true)
)

let private textOf (element : IWebElement) =
match element.TagName with
Expand Down