This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # idle.rb: | |
| require 'rubygems' | |
| require 'operawatir' | |
| browser = OperaWatir::Browser.new | |
| puts "OperaIdle: #{browser.driver.isOperaIdleAvailable}" | |
| browser.quit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'operawatir/helper' | |
| require 'clipboard' | |
| describe 'Opera' do | |
| describe 'Clipboard' do | |
| before :each do | |
| browser.url = 'http://t/test.html' | |
| window.p(:id, 'test').double_click |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'rbconfig' | |
| require 'rspec' | |
| class PlatformDependentExample | |
| def platform | |
| case RbConfig::CONFIG['host_os'] | |
| when /windows/ | |
| :windows | |
| when /linux/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'rbconfig' | |
| require 'rspec' | |
| class PlatformDependentExample | |
| def platform | |
| case RbConfig::CONFIG['host_os'] | |
| when /windows/ | |
| :windows | |
| when /linux/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'rbconfig' | |
| require 'rspec' | |
| class PlatformDependentExample | |
| def platform | |
| case RbConfig::CONFIG['host_os'] | |
| when /windows/ | |
| :windows | |
| when /linux/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ● operawatir button.rb | |
| .....OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| ..OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Element#compare_hash is deprecated. Please use element.visual_hash. | |
| .OperaWatir::Browser#key is deprecated. Please use browser.keys.send. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'operawatir' | |
| browser = OperaWatir::Browser.new | |
| browser.goto 'http://en.wikipedia.org/' | |
| browser.text_field(:id, 'searchInput').set 'Arabia' | |
| browser.button(:id, 'searchButton').click | |
| browser.quit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OperaWatir::Screenshot | |
| attr_accessor :browser, :reply | |
| def initialize(parent) | |
| self.browser = parent.browser | |
| self.reply = driver.saveScreenshot(2, [].to_java(:string)) | |
| end | |
| def save(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def screenshot(filename = nil) | |
| filename.empty? ? OperaWatir::Screenshot.new(self).save(filename) : OperaWatir::Screenshot.new(self) | |
| end |