2017-06-21 21 views
0

我想在移動瀏覽器中自動化網站,並且我有一種情況需要關閉數據..我嘗試使用此代碼,但它沒有工作..無法使用appium打開或關閉數據

((AndroidDriver)driver)).setConnection(Connection.AIRPLANE); 

我在Appium上得到以下錯誤。

[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9/element/0 
.6472704682468642-1/value] to [POST http://127.0.0.1:8000/wd/hub/session/cdcd3aa83e0133e7e9a73007fe1 
843b4/element/0.6472704682468642-1/value] with body: {"id":"0.6472704682468642-1","value":["banana"] 
} 
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"cdcd3aa83e0133e7e9a73007fe1843b4" 
,"status":0,"value":null} 
[JSONWP Proxy] Replacing sessionId cdcd3aa83e0133e7e9a73007fe1843b4 with 2a5f7f01-e387-46f0-ac31-8dd 
61a6e35a9 
[HTTP] <-- POST /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9/element/0.6472704682468642-1/va 
lue 200 634 ms - 76 
[HTTP] --> POST /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9/network_connection {"name":"net 
work_connection","parameters":{"type":1}} 
[MJSONWP] Driver proxy active, passing request on via HTTP proxy 
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9/network_c 
onnection] to [POST http://127.0.0.1:8000/wd/hub/session/cdcd3aa83e0133e7e9a73007fe1843b4/network_co 
nnection] with body: {"name":"network_connection","parameters":{"type":1}} 
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"cdcd3aa83e0133e7e9a73007fe1843b4" 
,"status":13,"value":{"message":"unknown error: operation is unsupported on Android\n (Session info 
: chrome=58.0.3029.83)\n (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc5679 
15b233),platform=Windows NT 6.1.7601 SP1 x86_64)"}} 
[JSONWP Proxy] Replacing sessionId cdcd3aa83e0133e7e9a73007fe1843b4 with 2a5f7f01-e387-46f0-ac31-8dd 
61a6e35a9 
[HTTP] <-- POST /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9/network_connection 200 26 ms - 
302 
[HTTP] --> DELETE /wd/hub/session/2a5f7f01-e387-46f0-ac31-8dd61a6e35a9 {} 
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: ["2a5f7f01-e387-46f0-ac31-8dd61a6e 
35a9"] 
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1498038746866 (15:22:26 GMT+0530 (India 
Standard Time)) 
[debug] [AndroidDriver] Shutting down Android driver 

錯誤日誌 -

[email protected]6a64: org.openqa.selenium.WebDriverException: unknown error: operation is unsupported on Android 
    (Session info: chrome=58.0.3029.83) 
    (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 35 milliseconds 
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' 
System info: host: 'GH-XXXXXXX', ip: 'xxx.xxx.xxx.xxx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_20' 

難道我在這裏錯過了什麼?

Appium版本 - 1.6.4

回答