title: Deleting text in text view during XC UI Test?
body: <p>I am trying to delete the previous value from text view,but I am unable to since the cursor is always at the beginning of text view.I am using </p>
  
  <pre><code>extension XCUIElement {
      /**
       Removes any current text in the field before typing in the new value
       - Parameter text: the text to enter into the field
       */
      func clearAndEnterText(text: String) -&gt; Void {
          guard let stringValue = self.value as? String else {
              XCTFail("Tried to clear and enter text into a non string value")
              return
          }
  
          self.tap()
  
          let deleteString = stringValue.characters.map { _ in XCUIKeyboardKeyDelete }.joinWithSeparator("")
  
          self.typeText(deleteString)
          self.typeText(text)
      }
  }
  </code></pre>
  
  <p>source : <a href="https://stackoverflow.com/a/32894080/2563133">https://stackoverflow.com/a/32894080/2563133</a></p>