Class: AndroidChrome

Inherits:
Object
  • Object
show all
Defined in:
lib/testnow/android_chrome.rb

Instance Method Summary collapse

Instance Method Details

#android_chrome_configObject



4
5
6
7
8
9
10
# File 'lib/testnow/android_chrome.rb', line 4

def android_chrome_config
	@client = Selenium::WebDriver::Remote::Http::Default.new
	@client.read_timeout = 120
	@service = Selenium::WebDriver::Chrome::Service.new("/usr/local/bin/chromedriver", 9515, {})
	@service.start
	@caps = Selenium::WebDriver::Remote::Capabilities.chrome('chromeOptions'=> {'androidPackage' => 'com.android.chrome'})
end

#launch_driver_android_chromeObject



12
13
14
15
16
17
# File 'lib/testnow/android_chrome.rb', line 12

def launch_driver_android_chrome
	self.android_chrome_config
 	driver = Selenium::WebDriver.for(:remote, :http_client => @client, :url => @service.uri, :desired_capabilities => @caps)
 	driver.manage.timeouts.implicit_wait = 60
 	return driver
end

#launch_watir_android_chromeObject



19
20
21
22
23
24
# File 'lib/testnow/android_chrome.rb', line 19

def launch_watir_android_chrome
	self.android_chrome_config
 	browser = Watir::Browser.new(:remote, :url => @service.uri, :desired_capabilities => @caps, :http_client => @client)
 	browser.driver.manage.timeouts.implicit_wait = 60
 	return browser
end