From d6e4f0c75447e2c8939ae272400a6bd1e9698a79 Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Sat, 27 Feb 2016 16:17:48 -0600 Subject: [PATCH] Make clear before write configuralbe #236 --- src/canopy/canopy.fs | 2 +- src/canopy/configuration.fs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/canopy/canopy.fs b/src/canopy/canopy.fs index cc6a7fcc..3ce0a790 100644 --- a/src/canopy/canopy.fs +++ b/src/canopy/canopy.fs @@ -317,7 +317,7 @@ let private writeToElement (e : IWebElement) (text:string) = let readonly = e.GetAttribute("readonly") if readonly = "true" then raise (CanopyReadOnlyException(sprintf "element %s is marked as read only, you can not write to read only elements" (e.ToString()))) - try e.Clear() with ex -> ex |> ignore + if not optimizeByDisablingClearBeforeWrite then try e.Clear() with ex -> ex |> ignore e.SendKeys(text) let ( << ) item text = diff --git a/src/canopy/configuration.fs b/src/canopy/configuration.fs index 7239010b..4653beb7 100644 --- a/src/canopy/configuration.fs +++ b/src/canopy/configuration.fs @@ -32,6 +32,7 @@ let mutable configuredFinders = finders.defaultFinders let mutable writeToSelectWithOptionValue = true let mutable optimizeBySkippingIFrameCheck = false let mutable optimizeByDisablingCoverageReport = false +let mutable optimizeByDisablingClearBeforeWrite = false let mutable showInfoDiv = true let mutable failureScreenshotsEnabled = true let mutable skipAllTestsOnFailure = false