How to get current status appium?

Hello,

Is there anyway to know the current status of Appium server?

We need to know the status of the server when the script gets failed or in case if any exception gets occured.

What you mean by “current status of Appium server” ? Can you please ask with example?

Suppose in case of any failure appium session returns error code as 500, so is there anyway to read that code?

No I did not see anything like that yet, I handle every thing via selenium web driver code because all appium errors during run mode are because of our app. or code mistake.

I have below information. Your question may be different just thought of shairing

It’s just a server status if it’s up and running to accept commands

Hit url http://127.0.0.1:4725/wd/hub/status

If should return below json string
{“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

3 Likes

Thanks Amit,I was seeking for same information only.

This is really helpful.

Hi @Mitesh_Agarwal,

have u implemented in code ? or are you handling it manually ?

Hi,

how can we handle this in code? Like as we said above, we want to check if status is 200 or 500?.. as per JSON string pasted, does status code “0” determine success? if yes , how can I verify through code?

Hi,

u can send HTTP GET request and check for 200 OK status in response code.
Or if u can launch browser then u can read below json using locator and verify if server is ready to accept commands
{“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}