title: Testing drag and drop in ruby
body: <p>I am trying to test a UI that has the ability to drag and drop. All im looking to do is to drag an element to another element on the page. The code is below.</p>
  
  <pre><code>it 'should drag and drop' do                
      draggable = @driver.find('//*[@id="2"]').first
      droppable = @driver.find('//*[@id="dropmembers4"]').first
      draggable.drag_to(droppable)
      @driver.find('//div[contains(., "Dropped!")]').should_not be_nil    
  end
  </code></pre>
  
  <p>Currently im getting an error: </p>
  
  <pre><code>Failure/error: draggable = @driver.find('//*[@id="2"]').first
  No method error: undefined method 'find' for nil:NilClass
  </code></pre>
  
  <p>Any help would be great.</p>
  
  <p>Thanks</p>