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
# File 'lib/testnow/android_chrome.rb', line 4

def android_chrome_config
	@client = Selenium::WebDriver::Remote::Http::Default.new
   	@client.timeout = 120
   	@service = Selenium::WebDriver::Chrome::Service.new("/usr/local/bin/chromedriver")
	@service.start
end

#launch_driver_android_chromeObject



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

def launch_driver_android_chrome
	self.android_chrome_config
 	caps = {'chromeOptions'=> {'androidPackage' => 'com.android.chrome'}}
 	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
25
# File 'lib/testnow/android_chrome.rb', line 19

def launch_watir_android_chrome
	self.android_chrome_config
 	caps = {'chromeOptions'=> {'androidPackage' => 'com.android.chrome'}}
 	browser = Watir::Browser.new(:remote, :url => @service.uri, :desired_capabilities => @cap, :http_client => @client)
 	browser.driver.manage.timeouts.implicit_wait = 60
 	return browser
end