2016-07-25 4 views
1

Ich versuche, einige Aktionen in einem Browser mit Selendroid zu automatisieren. Ich schaffte es, den Server in Gang zu bringen. Wenn ich http://localhost:4444/wd/hub/status gehen, hier ist die AntwortSelendroid - Verbindung zum Selendroid-Server kann nicht hergestellt werden, vorausgesetzt, er läuft nicht

{"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} 

angezeigt, dass das Gerät auch erkannt. Ich benutze ein echtes Telefon, verbunden über USB. Alles sieht gut aus, aber wenn ich das Testskript starte, startet das Telefon die Anwendung, aber Selendroid-Server sagt, dass es keine Verbindung herstellen kann.

Die Ausgabe von Selendroid ist unten dargestellt. Es gibt mehr, aber hier beginnt es.

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. 

Wenn ich überlasse es läuft, es ist nur in einer Schleife zu bleiben, hält diesen Fehler zeigt, wahrscheinlich wieder zu verbinden versucht.

ich die neueste selendroid Version, selendroid-Standalone-0.17.0-mit-depende, bekam sie von ihrer Website: http://selendroid.io

Die Testskript Ich renne in Python geschrieben. Hier ist es:

Mein Betriebssystem ist Archbang, Linux Archbang 4.6.4-1-ARCH.

Alle Vorschläge sind willkommen

EDIT

ich es geschafft, einen Schritt weiter zu kommen. Sieht aus wie selendroid mit der App Argument Satz starten, wie folgt aus:

java -jar selendroid-standalone-0.17.0-with-dependencies.jar -app selendroid-test-app-0.17.0.apk 

und die gewünschten Funktionen in meinem Python Testskript zu ändern, wie folgt aus:

desired_capabilities = {'aut': 'io.selendroid.testapp'} 

Sie haben mich auf Schritt weiter. Ich habe die aut mit dem aapt Werkzeug, das mit dem Android-SDK kommt. Hier ist der Befehl, den ich benutzt habe:

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

Nun, mein Telefon die Heimat Aktivität bis pops-up, das nicht vorher. Ich erhalte immer noch den Fehler im Selendroid-Server, der gleiche Fehler.

Antwort

0

Ich schaffte es, es durch den Wechsel zu anderen Betriebssystem zu arbeiten. Ich wechselte zu einem Ubuntu basierten, aber ich denke es spielt keine Rolle.

Verwandte Themen