java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Not able to create a new session getting error org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'DESKTOP-0OFTRJ2', ip: '172.15.15.9'

Open ShivaAntier opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

In my system the appium is working fine on only one project but if I create a new project it is not working as the capabilities are same that i am passing but it always gives the error as

### org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'DESKTOP-0OFTRJ2', ip: '172.15.15.9'

Facing the same issue with all laptops in my company

Expected Behavior

it should work on any new project that i am creating in my system.

Minimal Reproducible Example

package AnCrypto;

import io.appium.java_client.AppiumDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

public class BaseClass {
    public static AppiumDriver driver;
    public static DesiredCapabilities cap;

//    @Test
    public void openApp() throws MalformedURLException, InterruptedException {
        BaseClass bc = new BaseClass();
        cap = new DesiredCapabilities();
        cap.setCapability("automationName", "Appium");
//        cap.setCapability("automationName", "Appium");
        cap.setCapability("VERSION", "12.0");
        cap.setCapability("deviceName", "realme RMX3381");//moto e(7) plus  Android SDK built for x86 N7I7UCAUOZ5T499P
        cap.setCapability("platformName", "Android");
        cap.setCapability("adbExecTimeout", "80000");
        cap.setCapability("appPackage", "com.ancryptoWallet");
        cap.setCapability("appActivity", "com.ancrypto.MainActivity");
//        cap.setCapability("appPackage","com.evoeurope");
//        cap.setCapability("appActivity","com.coincult.MainActivity");
        cap.setCapability("autoGrantPermissions", "true");
        cap.setCapability("autoAcceptAlerts", "true");

        driver = new AppiumDriver(new URL("http://localhost:4723/wd/hub"), cap);
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
        Thread.sleep(2000);
        System.out.println("application started");
        // END OF CODE
    }
}

Environment

Device name Shiva-ATR632 Processor 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz 2.42 GHz Installed RAM 16.0 GB (15.8 GB usable) Device ID DD96A306-2616-4F79-853C-12772B5CF389 Product ID 00356-24525-50323-AAOEM System type 64-bit operating system, x64-based processor Pen and touch Pen support

Link to Appium Logs

No response

Futher Information

No response

ShivaAntier avatar Feb 06 '23 10:02 ShivaAntier

The error means the server did not start. Please provide the full server log and make sure that it is really listening on the given url (aka http://localhost:4723/wd/hub)

mykola-mokhnach avatar Feb 06 '23 10:02 mykola-mokhnach