sorry didnt see the code I have never had success with them on the same line I think that if you ended up at the front of the line and press backspace it would have no effect on the text there What i was suggesting is selecting all of the text and deleting it
@browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"] @browser.frame(:class=>/gwt-**RichTextArea/).send_keys :delete or @browser.frame(:class=>/gwt-**RichTextArea/).send_keys :end @browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:shift,:home] @browser.frame(:class=>/gwt-**RichTextArea/).send_keys :delete On Tue, Sep 25, 2012 at 4:51 PM, Joe Fleck <[email protected]> wrote: > Hi Oscar, > > Thank you for responding. > > Isn't that what I am doing already? I am not fimiliar with send_keys > other than typing out text. > > Thank you, > Joe > On Sep 25, 2012 2:04 PM, "Oscar Rieken" <[email protected]> wrote: > >> why not send control A and then delete >> >> On Tue, Sep 25, 2012 at 2:04 PM, Joe Fl <[email protected]> wrote: >> >>> The problem I am having is when this line of code is >>> executed @browser.frame(:class=>/gwt-**RichTextArea/).click >>> in Chrome the cursor is place at the end of the string and in Firefox >>> the cursor ends up in front of the string. >>> >>> So the backspace isn't deleting the current text. >>> >>> >>> Thank you and any help would be greatly appreciate. >>> Joe >>> >>> >>> On Tuesday, September 25, 2012 1:09:49 PM UTC-4, Joe Fl wrote: >>>> >>>> Hi everyone, >>>> >>>> I need to know if there is a better way to delete a string of text from >>>> a RichTextArea. >>>> >>>> >>>> Currently I handle it this way: >>>> @browser.frame(:class=>/gwt-**RichTextArea/).click >>>> # Erase old comment >>>> for rte in >>>> [email protected](:class=>/**gwt-RichTextArea/).body.text.**length >>>> #GF0TARWCJU hasRichTextToolbar').body.**text.length >>>> # delete text by backspacing. >>>> @browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"], >>>> :backspace >>>> end >>>> >>>> Is there a better way to do this with watir-webdriver? >>>> >>>> >>>> Image Included: >>>> >>>> Thank you, >>>> Joe >>>> >>>> >>>> >>>> -- >>> Before posting, please read http://watir.com/support. In short: search >>> before you ask, be nice. >>> >>> [email protected] >>> http://groups.google.com/group/watir-general >>> [email protected] >>> >> >> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> [email protected] >> http://groups.google.com/group/watir-general >> [email protected] >> > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
