Sha256: 254f0fc9cd70d06119d8afa5c4cef936cd39b8f9c153af7e8d93450867b20a64

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

require File.dirname(__FILE__) + '/element'

# Basic Link object.
# Subclass of Element.
class Link < Element
    # Clicks on object and waits for page to load or refresh
    def click(url=nil)
	if url == nil
	    begin
		@selenium.click(@locator)
	    rescue => e
		sleep(3)
		@selenium.click(@locator)
	    end
	    #sleep(2)
	    #@selenium.wait_for_condition("selenium.browserbot.getCurrentWindow()", TIMEOUT)	    
	    begin
		@selenium.wait_for_page_to_load
	    rescue => e
		sleep(2)
		@selenium.wait_for_condition("selenium.browserbot.getCurrentWindow()", TIMEOUT)	
	    end
	    
	else	    
	    @selenium.open_window(url,"newWindow")
	    @selenium.select_window("newWindow")
	end
    end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-rspec-dsl-1.0.2 sites/link.rb