Python Selendroid-Can';假设Selendroid服务器未运行,则无法连接到该服务器

Python Selendroid-Can';假设Selendroid服务器未运行,则无法连接到该服务器,python,selenium,selenium-webdriver,selendroid,Python,Selenium,Selenium Webdriver,Selendroid,我正在尝试使用selendroid在浏览器中自动执行一些操作。我设法让服务器运转起来。如果我去的话,下面是答案 {"value":{"os":{"name":"Linux","arch":"amd64","version":"4.6.4-1-ARCH"},"build":{"browserName":"selendroid","version":"0.17.0"},"supportedDevices":[{"emulator":false,"screenSize":"(480, 800)","s

我正在尝试使用selendroid在浏览器中自动执行一些操作。我设法让服务器运转起来。如果我去的话,下面是答案

{"value":{"os":{"name":"Linux","arch":"amd64","version":"4.6.4-1-ARCH"},"build":{"browserName":"selendroid","version":"0.17.0"},"supportedDevices":[{"emulator":false,"screenSize":"(480, 800)","serial":"47900eb4d5dc9100","platformVersion":"17","model":"GT-I8200","apiTargetType":"google"}],"supportedApps":[{"mainActivity":"io.selendroid.androiddriver.WebViewActivity","appId":"io.selendroid.androiddriver:0.17.0","basePackage":"io.selendroid.androiddriver"}]},"status":0}
显示设备也被识别。我用的是一部真正的手机,通过USB连接。 一切看起来都很好,但当我启动测试脚本时,手机启动了应用程序,但selendroid服务器告诉我它无法连接

selendroid的输出如下所示。还有更多,但这里是它的起点

Jul 25, 2016 10:11:41 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell am instrument -e main_activity io.selendroid.androiddriver.WebViewActivity -e server_port 1235 io.selendroid.io.selendroid.androiddriver/io.selendroid.server.ServerInstrumentation
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->

<--
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 forward tcp:1235 tcp:1235
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->

<--
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.android.impl.AbstractDevice startLogging
INFO: starting logcat:
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.server.model.SelendroidStandaloneDriver waitForServerStart
INFO: Waiting for the Selendroid server to start.
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Checking if the Selendroid server is running: http://localhost:1235/wd/hub/status
Jul 25, 2016 10:11:41 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Can't connect to Selendroid server, assuming it is not running.
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell echo $EXTERNAL_STORAGE
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
/storage/emulated/legacy
<--
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell ls /storage/emulated/legacy/
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
Alarms
Android
Bluetooth
DCIM
Documents
Download
Movies
Music
Nearby
Notifications
Pictures
Playlists
Podcasts
Ringtones
Sounds
TMemo
<--
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Checking if the Selendroid server is running: http://localhost:1235/wd/hub/status
Jul 25, 2016 10:11:43 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Can't connect to Selendroid server, assuming it is not running.
Jul 25, 2016 10:11:45 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell echo $EXTERNAL_STORAGE
Jul 25, 2016 10:11:45 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
/storage/emulated/legacy
<--
Jul 25, 2016 10:11:45 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell ls /storage/emulated/legacy/
Jul 25, 2016 10:11:46 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
Alarms
Android
Bluetooth
DCIM
Documents
Download
Movies
Music
Nearby
Notifications
Pictures
Playlists
Podcasts
Ringtones
Sounds
TMemo
<--
Jul 25, 2016 10:11:46 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Checking if the Selendroid server is running: http://localhost:1235/wd/hub/status
Jul 25, 2016 10:11:46 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Can't connect to Selendroid server, assuming it is not running.
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell echo $EXTERNAL_STORAGE
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
/storage/emulated/legacy
<--
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: /home/icebox/Android/Sdk/platform-tools/adb -s 47900eb4d5dc9100 shell ls /storage/emulated/legacy/
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
Alarms
Android
Bluetooth
DCIM
Documents
Download
Movies
Music
Nearby
Notifications
Pictures
Playlists
Podcasts
Ringtones
Sounds
TMemo
<--
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Checking if the Selendroid server is running: http://localhost:1235/wd/hub/status
Jul 25, 2016 10:11:48 PM io.selendroid.standalone.android.impl.AbstractDevice isSelendroidRunning
INFO: Can't connect to Selendroid server, assuming it is not running.
我的操作系统是archbang,Linux archbang 4.6.4-1-ARCH

如有任何建议,我们将不胜感激

编辑

我又向前迈了一步。看起来像是用app参数集启动selendroid,如下所示:

java -jar selendroid-standalone-0.17.0-with-dependencies.jar -app selendroid-test-app-0.17.0.apk
desired_capabilities = {'aut': 'io.selendroid.testapp'}
并在python测试脚本中更改所需的功能,如下所示:

java -jar selendroid-standalone-0.17.0-with-dependencies.jar -app selendroid-test-app-0.17.0.apk
desired_capabilities = {'aut': 'io.selendroid.testapp'}
让我更进一步。 我使用安卓sdk附带的
aapt
工具获得了aut。以下是我使用的命令:

./aapt dump badging ~/Desktop/selendroid/selendroid-test-app-0.17.0.apk

现在,我的手机弹出了家庭活动,这是以前没有的。但我仍然在selendroid服务器中遇到错误,同样的错误。

我通过切换到不同的操作系统使其正常工作。我换了一个基于ubuntu的,但我想这并不重要。

我通过切换到不同的操作系统使它工作起来。我换了一个基于ubuntu的,但我想这没关系