Thanks guys, I figured out how to solve it

I was trying to test a functionality a accomplish using the jquery rangy 
plugin

http://code.google.com/p/rangy/

Since this plugin requires the window.getSelection() function from the 
browser I just inject a test range with the following code

  browser = Watir::Browser.new :chrome
    a = browser.div(:id => "block")
    
    a.fire_event "mousedown"

    selection_script = "var range = document.createRange();"
    selection_script  << "var start = document.getElementById('block'); "
    selection_script  <<  "range.setStart(start,0); "
    selection_script  <<  "range.setEnd(start,10);"
    selection_script << "window.getSelection().addRange(range);"
    
    browser.execute_script selection_script
    
    b.fire_event "mouseup"

I use the mousedown, mouseup on my js backend and them I use the selection 
data, so I need those events too.


Regards
Andres

-- 
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]

Reply via email to