Skip to content

io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException: The local appium server has not been started. The given Node.js executable: /usr/local/bin/node Arguments: [/usr/local/lib/node_modules/appium/build/lib/main.js #1504

@RehanProgrammer

Description

@RehanProgrammer

Description

HI, Im facing this issue of starting appium server programatically. I have gone through many other github threads about this same issue but to no luck.

Environment

Appium version: 1.21.0 (latest)

Node: v12.19.0

Details

I am calling the service on rest template. I tried many ways of starting an appium server programmatically but non worked. Please help

Code To Reproduce Issue

public class AppiumServer {

private static AppiumDriverLocalService server;
private int port;

public AppiumServer() {
   server =  buildAppiumServer();
}

private AppiumDriverLocalService buildAppiumServer() {
    return new AppiumServiceBuilder().usingAnyFreePort()
            .withIPAddress( "127.0.0.1" )
            .withArgument( GeneralServerFlag.LOG_LEVEL, "error" )
            .withArgument( GeneralServerFlag.SESSION_OVERRIDE )
            .build();
}

public void start(){

    this.server.start();
}

public void stop() {
    this.server.stop();
}

public AppiumDriverLocalService get(){
    return this.server;
}

}

Exception Stacktraces

Caused by: io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException: The local appium server has not been started. The given Node.js executable: /usr/local/bin/node Arguments: [/usr/local/lib/node_modules/appium/build/lib/main.js, --port, 3784, --address, 127.0.0.1, --log-level, error, --session-override]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions