Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View irb.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
>> d = Selenium::WebDriver.for :android
=> #<Selenium::WebDriver::Driver:0x2cb7e9e951b9baae browser=:android>
>> d.get "http://google.com"
=> nil
>> d.online?
=> true
>> d.online = false
=> false
>> d.online?
=> true
>> $DEBUG = true
=> true
>> d.online?
-> GET session/1327619076728/browser_connection
Exception `Errno::EAGAIN' at /Users/fijabakk/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
<- {"value":true,"class":"org.openqa.selenium.remote.Response","sessionId":"1327619076728","status":0,"hCode":1099662880}
=> true
>> d.online?
-> GET session/1327619076728/browser_connection
Exception `Errno::EAGAIN' at /Users/fijabakk/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
<- {"value":true,"class":"org.openqa.selenium.remote.Response","sessionId":"1327619076728","status":0,"hCode":1100795888}
=> true
>> d.online = false
-> POST session/1327619076728/browser_connection
>>> {"state":false}
> {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"15"}
Exception `Errno::EAGAIN' at /Users/fijabakk/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
<-
=> false
>> d.online?
-> GET session/1327619076728/browser_connection
Exception `Errno::EAGAIN' at /Users/fijabakk/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
<- {"value":true,"class":"org.openqa.selenium.remote.Response","sessionId":"1327619076728","status":0,"hCode":1100053160}
=> true
>> d.quit
View irb.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
I/ActivityManager( 178): Displayed org.openqa.selenium.android.app/.MainActivity: +657ms
I/AndroidDriverServlet( 3385): Executing: [new session: {platform=ANDROID, javascriptEnabled=false, cssSelectorsEnabled=false, browserName=android, nativeEvents=false, rotatable=true, takesScreenshot=true, version=}] at URL: /session)
I/AndroidDriverServlet( 3385): Done: /session
I/AndroidDriverServlet( 3385): Executing: org.openqa.selenium.android.server.handler.GetCapabilities@419afdd8 at URL: /session/1327619076728)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728
D/dalvikvm( 3385): GC_CONCURRENT freed 401K, 5% free 15345K/16071K, paused 8ms+2ms
I/AndroidDriverServlet( 3385): Executing: [get: http://google.com] at URL: /session/1327619076728/url)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/url
D/androidNetworkLocationListeners( 510): Still have listener com.google.android.location.internal.client.NetworkLocationClient$1@41837ec0
D/androidNetworkLocationListeners( 510): Still have listener com.google.android.location.internal.client.NetworkLocationClient$1@41837ec0
D/dalvikvm( 510): GC_CONCURRENT freed 499K, 5% free 15140K/15815K, paused 2ms+2ms
I/AndroidDriverServlet( 3385): Executing: [get browser connection state] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
I/AndroidDriverServlet( 3385): Executing: [set browser connection : false] at URL: /session/1327619076728/browser_connection)
W/webview ( 3385): java.lang.Throwable: Warning: A WebView method was called on thread 'pool-8-thread-1'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
W/webview ( 3385): at android.webkit.WebView.checkThread(WebView.java:9355)
W/webview ( 3385): at android.webkit.WebView.setNetworkAvailable(WebView.java:1699)
W/webview ( 3385): at java.lang.reflect.Method.invokeNative(Native Method)
W/webview ( 3385): at java.lang.reflect.Method.invoke(Method.java:511)
W/webview ( 3385): at org.openqa.selenium.android.library.ReflexionHelper.invoke(ReflexionHelper.java:47)
W/webview ( 3385): at org.openqa.selenium.android.library.ViewAdapter.setNetworkAvailable(ViewAdapter.java:153)
W/webview ( 3385): at org.openqa.selenium.android.library.NetworkStateHandler.onNetworkChange(NetworkStateHandler.java:86)
W/webview ( 3385): at org.openqa.selenium.android.library.AndroidWebDriver.setOnline(AndroidWebDriver.java:1221)
W/webview ( 3385): at org.openqa.selenium.android.AndroidDriver.setOnline(AndroidDriver.java:116)
W/webview ( 3385): at org.openqa.selenium.remote.server.handler.html5.SetBrowserConnection.call(SetBrowserConnection.java:40)
W/webview ( 3385): at org.openqa.selenium.remote.server.handler.html5.SetBrowserConnection.call(SetBrowserConnection.java:1)
W/webview ( 3385): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/webview ( 3385): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/webview ( 3385): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/webview ( 3385): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/webview ( 3385): at java.lang.Thread.run(Thread.java:856)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
D/dalvikvm( 3385): GC_CONCURRENT freed 437K, 5% free 15384K/16071K, paused 6ms+3ms
I/AndroidDriverServlet( 3385): Executing: [get browser connection state] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
I/AndroidDriverServlet( 3385): Executing: [get browser connection state] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
D/androidNetworkLocationListeners( 510): Still have listener com.google.android.location.internal.client.NetworkLocationClient$1@41837ec0
D/dalvikvm( 510): GC_CONCURRENT freed 498K, 5% free 15104K/15815K, paused 2ms+2ms
W/ThrottleService( 178): unable to find stats for iface rmnet0
I/AndroidDriverServlet( 3385): Executing: [get browser connection state] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
I/AndroidDriverServlet( 3385): Executing: [set browser connection : false] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
D/dalvikvm( 3385): GC_CONCURRENT freed 415K, 5% free 15388K/16071K, paused 2ms+3ms
I/AndroidDriverServlet( 3385): Executing: [get browser connection state] at URL: /session/1327619076728/browser_connection)
I/AndroidDriverServlet( 3385): Done: /session/1327619076728/browser_connection
^LW/Smack/Packet( 510): notify conn break (IOEx), close connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.