Appium Session Issue

My all test cases not executed. It executed in the following manner
1
3
5

it will terminate the session for 2 and 4 cases.

Please help me How to maintain Appium session

My appium INit code is following

/* Start and Stop Appium Server Script */

package Utilities;

import com.cucumber.listener.Reporter;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static org.testng.AssertJUnit.assertTrue;

public class AppiumController {

private static String platformName;
private static String deviceName;
private static String platformVersion;
private static String app;
private static String appPackage;
private static String appActivity;


public static AppiumController instance = new AppiumController();

public static AndroidDriver<MobileElement> driver;

public static String rootPath = System.getProperty("user.dir");

AppiumDriverLocalService service;

// String Appium_Node_Path="C:\\Program Files\\nodejs\\node.exe";
// String Appium_JS_Path="C:\\Users\\win10\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js";
//static String service_url;
//private String appiumPort;
//private String serverIp;


@Before
public AndroidDriver<MobileElement> start() throws MalformedURLException {

    //  Reporter.assignAuthor("KASH-Automation Team");

    Properties pro = new Properties();
    try {
        InputStream input = new FileInputStream(rootPath + "\\src\\test\\java\\Config\\config.properties");
        pro.load(input);

        platformName = pro.getProperty("platformName");
        deviceName = pro.getProperty("deviceName");
        platformVersion = pro.getProperty("platformVersion");
        app = pro.getProperty(rootPath + "/apk/KashNoDx.apk");
        appPackage = pro.getProperty("appPackage");
        appActivity = pro.getProperty("appActivity");

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }


    //service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().   //Start Appium implementation 1
    //        usingAnyFreePort().usingDriverExecutable(new File(Appium_Node_Path)).
    //       withAppiumJS(new File(Appium_JS_Path)));

    service = AppiumDriverLocalService.buildDefaultService(); //Start Appium implementation 2

    service.start();
    //service_url = service.getUrl().toString();

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("automationName", "appium");
    capabilities.setCapability("platformName", platformName);
    capabilities.setCapability("deviceName", deviceName);
    capabilities.setCapability("platformVersion", platformVersion);
    capabilities.setCapability("app", app);
    //capabilities.setCapability("app", "D:\\Coinca\\CoincaAutomation\\BitBucketCode\\kash_automated_testing\\apk\\KashNoDx.apk");
    capabilities.setCapability("appPackage", appPackage);
    capabilities.setCapability("appActivity", appActivity);
    capabilities.setCapability("autoGrantPermissions", "true");
    capabilities.setCapability("unicodeKeyboard", true);
    capabilities.setCapability("resetKeyboard", true);
    capabilities.setCapability("fastReset", true);
    // capabilities.setCapability("–session-override", true);

    driver = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);  //Start appium providing static url

    //String serverUrl = "http://" + serverIp + ":" + appiumPort + "/wd/hub";  //Start appium providing dynamic url
    // driver= new AndroidDriver(new URL(service_url),capabilities);


    driver.manage().timeouts().implicitlyWait(1, TimeUnit.MINUTES);
    return driver;
}

@After
public void stop(Scenario scenario) throws InterruptedException {
    if (scenario.isFailed()) {

        System.out.println(scenario.getName());
        final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
        // embed it in the report.
        scenario.embed(screenshot, "image/png");
    }

    if (driver != null) {
        // driver.resetApp();
        driver.quit();
        service.stop();

        Thread.sleep(5000);
        CommandLine command = new CommandLine("cmd");
        command.addArgument("/c");
        command.addArgument("Taskkill /F /IM node.exe");
        Thread.sleep(30000);
        //driver = null;
    }
}

}

I am getting following error
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 39281 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:"//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 40243 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 40918 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 41605 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 42228 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 42845 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 43524 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 44188 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 44988 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 45638 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 46367 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 47071 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 47726 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:“io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.nett
y.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [BaseDriver] Waited for 48564 ms so far
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8229/wd/hub/session/50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873/element] with body: {“strategy”:“xpath”,“selector”:”//andro
id.widget.FrameLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.ImageButton",“context”:"",“multiple”:false}
[WD Proxy] Got an unexpected response with status 404: {“sessionId”:“50e7c400-ccbb-4a1a-b23c-0e8dcb2a4873”,“value”:{“error”:“no such element”,“message”:“An element could not be located o
n the page using the given search parameters”,“stacktrace”:"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given
search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\t
at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n
tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.Terminate batch job (Y/N)? y

without your code in git - hardly we can help.

@Aleksei Hello, I have added code for Appium Initialization. Please help to rectify it.

so you added some class where we see before and after test annotations and we do not see tests.

  1. how we can understand what means 1,3 and 5?
  2. what means “it will terminate the session for 2 and 4 cases.” ?

suggestions:

  • tell us about your tests. we do not have them and cant understand.
  • add more logs in each function start and end
  • do not start Appium service with EACH test! start it only one time and stop one time. unfortunately beforeSuite does not exist in Junit -> https://github.com/junit-team/junit5/issues/456 . So try to use beforeClass (or new one beforeAll) to start appium service and stop in afterClass (afterAll).

@Aleksei I mean , I have 6 scenario’s . It is executing first scenario then got error while executing second scenario then third scenario executing fine then again get same error vice versa

Following is my scenario file
@Login
Feature: Sign In
As an user of the KASH
I want to login to the Application with user credentials
In order to use the application features.

Background: User Launch the Application
Given Start test environment setup to execute test cases

@HappyPath
Scenario: Happy Path:- Login KASH with Valid Username and Password
When Enter valid Kashtag “abctedfg” and valid Password “123as3”
And I should see transfer text message on homescreen
Then I should be able to logout

@HappyPathSanity
Scenario Outline: Login KASH with Valid Username and Password
When Enter valid Kashtag “” and valid Password “”
And I should see transfer text message on homescreen
Then I should be able to logout

Examples:
  | kashtag | Password |
 | test12345 | test12345 |
  | test12345 | test12345 |

@NegativePath
Scenario: Negative Path:- Login KASH with InValid Username and Password
When Enter Invalid Kashtag “test12345” and Invalid Password “test12345!”
And I should see validation message on loginscreen

@NegativePathSanity
Scenario Outline: Login KASH with InValid Username and Password
When Enter Invalid Kashtag “” and Invalid Password “”
And I should see validation message on loginscreen

Examples:
  | kashtag   | Password  |
  | test12345 | test12345 |
  | test12345 | test12345 |

Error is “Org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up”

I just want to execute all my 6 scenarios without failure .
Please help me

Detail Log:-
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVersion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 420, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, platform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top: 63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: ba1a8eb3-6435-48fa-ba24-fe5427118aa9

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:39)
at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:56)
at io.appium.java_client.HasSessionDetails.isBrowser(HasSessionDetails.java:86)
at io.appium.java_client.AppiumDriver.isBrowser(AppiumDriver.java:271)
at io.appium.java_client.pagefactory.utils.WebDriverUnpackUtility.lambda$0(WebDriverUnpackUtility.java:87)
at java.util.Optional.map(Optional.java:215)
at io.appium.java_client.pagefactory.utils.WebDriverUnpackUtility.getCurrentContentType(WebDriverUnpackUtility.java:83)
at io.appium.java_client.pagefactory.AppiumElementLocator.getBy(AppiumElementLocator.java:90)
at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:117)
at io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement.intercept(InterceptorOfASingleElement.java:59)
at io.appium.java_client.android.AndroidElement$$EnhancerByCGLIB$$b598166c.getText(<generated>)
at Pages.LoginScreen.verifywithValidcredentials(LoginScreen.java:90)
at StepDefination.DebitCardstepDefination.enterValidKashtagAndValidPasswordToValidateDebitCardFunctionality(DebitCardstepDefination.java:35)
at ✽.When Enter valid Kashtag "pgreena" and valid Password "Queso123" to validate Debit Card functionality(D:/Coinca/CoincaAutomation/BitBucketCode/kash_automated_testing/src/test/java/Feature/TC_002_DebitCard.feature:10)

@Aleksei I am using the Appium 1.17 version. Please help me I am stuck in it.

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Erro
r: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity:
com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVe
rsion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 4
20, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, pl
atform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top:
63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: d040ca74-e3d6-4835-98d6-5691b75714a9
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:39)
at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:56)
at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:65)
at io.appium.java_client.pagefactory.AppiumFieldDecorator.(AppiumFieldDecorator.java:96)
at io.appium.java_client.pagefactory.AppiumFieldDecorator.(AppiumFieldDecorator.java:144)
at Pages.LoginScreen.(LoginScreen.java:53)
at StepDefination.DebitCardstepDefination.iShouldBeOnHomescreen(DebitCardstepDefination.java:48)
at ?.And User should be on Homescreen(src/test/java/Feature/TC_002_DebitCard.feature:11)

FAILED: feature(Add_New_Debit_Card)
Runs Cucumber Feature
cucumber.runtime.CucumberException: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to
remote server. Original error: Error: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity:
com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVe
rsion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 4
20, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, pl
atform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top:
63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: d040ca74-e3d6-4835-98d6-5691b75714a9
at cucumber.api.testng.TestNGCucumberRunner.runCucumber(TestNGCucumberRunner.java:69)
at Myrunner.TestRunnerTestNG.feature(TestRunnerTestNG.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original
error: Error: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity:
com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVe
rsion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 4
20, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, pl
atform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top:
63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: d040ca74-e3d6-4835-98d6-5691b75714a9
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:39)
at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:56)
at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:65)
at io.appium.java_client.pagefactory.AppiumFieldDecorator.(AppiumFieldDecorator.java:96)
at io.appium.java_client.pagefactory.AppiumFieldDecorator.(AppiumFieldDecorator.java:144)
at Pages.LoginScreen.(LoginScreen.java:53)
at StepDefination.DebitCardstepDefination.iShouldBeOnHomescreen(DebitCardstepDefination.java:48)
at ?.And User should be on Homescreen(src/test/java/Feature/TC_002_DebitCard.feature:11)

===============================================

D:/Coinca/CoincaAutomation/BitBucketCode/kash_automated_testing
Tests run: 1, Failures: 1, Skips: 0

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 245.979 s <<< FAILURE! - in TestSuite
[ERROR] feature(Myrunner.TestRunnerTestNG) Time elapsed: 241.67 s <<< FAILURE!
cucumber.runtime.CucumberException:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Erro
r: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity:
com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVe
rsion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 4
20, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, pl
atform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top:
63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: d040ca74-e3d6-4835-98d6-5691b75714a9
at Myrunner.TestRunnerTestNG.feature(TestRunnerTestNG.java:50)
Caused by: org.openqa.selenium.WebDriverException:
An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-9RLF69M’, ip: ‘192.168.184.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_241’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, databaseEnabled: false, desired: {appActivity:
com.namutek.kash.MainActivity, appPackage: com.namutek.kash, autoGrantPermissions: true, automationName: appium, deviceName: emulator, fastReset: true, platformName: android, platformVe
rsion: 9, resetKeyboard: true, unicodeKeyboard: true}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: AOSP on IA Emulator, deviceName: emulator-5554, deviceScreenDensity: 4
20, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, fastReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, pl
atform: LINUX, platformName: Android, platformVersion: 9, resetKeyboard: true, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: true, viewportRect: {height: 1731, left: 0, top:
63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: d040ca74-e3d6-4835-98d6-5691b75714a9

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestRunnerTestNG.feature:50 » Cucumber org.openqa.selenium.WebDriverException:…
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.

Please refer to D:\Coinca\CoincaAutomation\BitBucketCode\kash_automated_testing\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[INFO]
[INFO] — maven-jar-plugin:2.4:jar (default-jar) @ Coinca —
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: D:\Coinca\CoincaAutomation\BitBucketCode\kash_automated_testing\target\Coinca-1.0-SNAPSHOT.jar
[INFO]
[INFO] — maven-cucumber-reporting:3.13.0:generate (execution) @ Coinca —
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property ‘org.apache.logging.log4j.simplelog.StatusLogg
er.level’ to TRACE to show Log4j2 internal initialization logging.
[INFO] About to generate Cucumber report.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:19 min
[INFO] Finished at: 2020-04-09T14:39:03+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.masterthought:maven-cucumber-reporting:3.13.0:generate (execution) on project Coinca: Error Found:: BUILD FAILED - Check Report For Details -> [Help 1]

[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

start from moving appium server start before all tests and close after all done.

@Aleksei : Thanks for the quick response. Script working fine now. I just added "newCommandTimeout " capability with 20000 value.