Hello all,
I just started appium automation on iOS. I got the automation working if I run appium server as HUB, but I couldn’t get it work as a grid connected to a HUB on the same MAC.
I used java -jar selenium-server-standalone-2.45.0.jar -role hub to start the HUB on local, and started appium server as a grid using this nodeconfig.json
{
"capabilities":
[
{
"browserName": "iOS",
"version":"8.1",
"maxInstances": 1,
"platform":"MAC"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":600000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4725/wd/hub",
"host": "127.0.0.1",
"port": 4725,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1"
}
}
The appium connected to the HUB successfully and this statement driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4444/wd/hub”), cap); created a new session on the appium grid, and the app I wanted to automate started up on the iOS device. However, it seems the HUB and the driver creation didn’t know the session was created, so my automation stuck at the driver creation state without sending any further commands. In this case, the appium grid will shut down this session after the 60s timeout waiting for new commands.
Here is the partial log from the appium grid:
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId e6b1d2b9-8ceb-4d25-a925-73cea8f1003a
info: <-- POST /wd/hub/session 303 16613.696 ms - 9
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.791 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.059 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.931 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 3.659 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.912 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 3.457 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 3.622 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.288 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.419 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.444 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.692 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 2.321 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.600 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 2.532 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: [debug] Didn't get a new command in 60 secs, shutting down...
info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments
info: [debug] [INST] 2015-03-06 00:52:23 +0000 Stopped: Script was stopped by the user
After the session was created, appium grid tried to tell the HUB that the session was created successfully, and I used tcpdump to check port 4444 and saw messages coming in during that time, but I didn’t know why the HUB didn’t notify my client that the session had been created so the the webdriver can send in other new commands. Is it possible that the selenium HUB doesn’t recognize the response from the appium grid?
Did anyone encounter this issue before? Any help will be appreciated. Thanks!