Skip to content

Commit

Permalink
Merge pull request #143 from rachelreese/master
Browse files Browse the repository at this point in the history
More idiomatically F#. :)
  • Loading branch information
lefthandedgoat committed Apr 6, 2014
2 parents 5851c9e + 74baeba commit d04e488
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit d04e488

Please sign in to comment.