Class: Watir::Safari

Inherits:
Object show all
Includes:
Container, PageContainer
Defined in:
lib/safariwatir.rb

Direct Known Subclasses

WebKit

Constant Summary

Constants included from Container

Container::DEFAULT_TYPING_LAG

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PageContainer

#html, #text, #title

Methods included from Container

#button, #cell, #checkbox, #contains_text, #div, #form, #frame, #image, #label, #link, #p, #password, #radio, #row, #select_list, #set_fast_speed, #set_slow_speed, #span, #speed=, #table, #text_field

Constructor Details

#initializeSafari

Returns a new instance of Safari.



504
505
506
507
508
# File 'lib/safariwatir.rb', line 504

def initialize
  @scripter = AppleScripter.new(JavaScripter.new)
  @scripter.ensure_window_ready
  set_slow_speed
end

Class Method Details

.start(url = nil) ⇒ Object



498
499
500
501
502
# File 'lib/safariwatir.rb', line 498

def self.start(url = nil)
  safari = new
  safari.goto(url) if url
  safari
end

Instance Method Details

#alertObject



528
529
530
# File 'lib/safariwatir.rb', line 528

def alert
  AlertWindow.new(scripter)
end

#closeObject



520
521
522
# File 'lib/safariwatir.rb', line 520

def close
  scripter.close
end

#goto(url) ⇒ Object



540
541
542
# File 'lib/safariwatir.rb', line 540

def goto(url)
  scripter.navigate_to(url)
end

#hideObject

Hide’s Safari



516
517
518
# File 'lib/safariwatir.rb', line 516

def hide
  scripter.hide
end

#quitObject



524
525
526
# File 'lib/safariwatir.rb', line 524

def quit
  scripter.quit
end

#reloadObject Also known as: refresh

Reloads the page



545
546
547
# File 'lib/safariwatir.rb', line 545

def reload
  scripter.reload
end

#security_warningObject



532
533
534
# File 'lib/safariwatir.rb', line 532

def security_warning
  SecurityWarningWindow.new(scripter)
end

#security_warning_at(url) ⇒ Object



536
537
538
# File 'lib/safariwatir.rb', line 536

def security_warning_at(url)
  SecurityWarningWindow.new(scripter, url)
end

#urlObject

URL of page



511
512
513
# File 'lib/safariwatir.rb', line 511

def url
  scripter.url
end