Skip to main content

Error Handling

Problem Statement

Tests are not running as expected, it is difficult to find out the root cause, appium related errors are thrown which are very difficult to be identified.

Solution provided by this framework

This framework handles all the events and throws a meaningful error using coteafs-error framework, which is easy to identify the cause of failure.

Following is the list of exception and their events of occurring:

ExceptionEvents
AppiumConfigParameterNotFoundErrorWhen the config file is missing mandatory params.
AppiumSelectorNotImplementedErrorWhen locator is invalid.
AppiumServerAlreadyRunningErrorWhen Appium server is already running.
AppiumServerLogFileErrorWhen there is error while deleting previous server logs.
AppiumServerNotRunningErrorWhen Appium server is not running.
AppiumServerNotStartingErrorWhen there is Error while starting the server.
AppiumServerNotStoppingErrorWhen there is Error while stopping the server.
AppiumServerStoppedErrorWhen trying to interact with device while Appium server is stopped.
DeviceAppNotClosingErrorWhen there is Error while closing Device app.
DeviceAppNotFoundErrorWhen device app is not found on local machine.
DeviceDesiredCapabilitiesNotSetErrorWhen device mandatory desired capabilities is not set.
DeviceDriverDefaultWaitErrorWhen there is Error while setting implicit waits.
DeviceDriverInitializationFailedErrorWhen there is Error while initializing device driver.
DeviceDriverNotStartingErrorWhen there is Error while starting device driver.
DeviceDriverNotStoppingErrorWhen there is Error while quitting device driver.
DeviceElementDisabledErrorWhen you are trying to interact with disabled element.
DeviceElementFindTimedOutErrorWhen element is not ready within specified explicit delay given in config file.
DeviceElementNameNotFoundErrorWhen element name is not found in Activity class.
DeviceElementNotDisplayedErrorWhen you are trying to interact with element which is not yet displayed.
DeviceElementNotFoundErrorWhen device element cannot be found.
DeviceTypeNotSupportedErrorWhen the mentioned device type is not supported by the framework.
NotEnoughBatteryChargeErrorWhen Battery charge is less than 20%.