python - Selendroid - Can't connect to Selendroid server, assuming it is not running -
i'm trying automate actions in browser, using selendroid. managed server going. if go http://localhost:4444/wd/hub/status, here's response
{"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} showing device recognized. i'm using real phone, connected through usb. looks good, when start test script, phone starts application, selendroid server it's telling cannot connect.
the output of selendroid shown below. there more, here starts.
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 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 selendroid server start. jul 25, 2016 10:11:41 pm io.selendroid.standalone.android.impl.abstractdevice isselendroidrunning info: checking if selendroid server 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 selendroid server, assuming 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 selendroid server 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 selendroid server, assuming 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 selendroid server 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 selendroid server, assuming 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 selendroid server 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 selendroid server, assuming not running. if leave running, it's staying in loop, keeps showing error, trying reconnect.
i'm using latest selendroid version, selendroid-standalone-0.17.0-with-depende, got website: http://selendroid.io
the test script i'm running written in python. here is:
#!/bin/python2.7 import unittest selenium import webdriver class findelementtest(unittest.testcase): def setup(self): d = webdriver.desiredcapabilities.android print d self.driver = webdriver.remote( desired_capabilities=d ) self.driver.implicitly_wait(30) def test_find_element_by_id(self): self.driver.get('and-activity://io.selendroid.testapp.homescreenactivity') self.asserttrue("and-activity://homescreenactivity" in self.driver.current_url) my_text_field = self.driver.find_element_by_id('my_text_field') my_text_field.send_keys('hello selendroid') self.asserttrue('hello selendroid' in my_text_field.text) def teardown(self): self.driver.quit() if __name__ == '__main__': unittest.main() my operating system archbang, linux archbang 4.6.4-1-arch.
any suggestions appreciated
edit
i managed 1 step further. looks starting selendroid app argument set, this:
java -jar selendroid-standalone-0.17.0-with-dependencies.jar -app selendroid-test-app-0.17.0.apk and changing desired capabilities in python test script, this:
desired_capabilities = {'aut': 'io.selendroid.testapp'} got me on step further. got aut using aapt tool, comes android-sdk. here's command i've used:
./aapt dump badging ~/desktop/selendroid/selendroid-test-app-0.17.0.apk now, phone home activity pops-up, didn't before. i'm still getting error in selendroid server though, same error.
i managed working switching different operating system. switched ubuntu based one, guess doesn't matter.
Comments
Post a Comment