appium/java-client

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure

ANSHUL786 opened this issue · 13 comments

Do I have the most recent component updates?

  • I use the most recent available driver/plugin and server versions

Is the component officially supported by the Appium team?

  • I have verified the component repository is present under the Appium organization in GitHub

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

when i am trying to run my appium code
getting below error

FAILED CONFIGURATION: @BeforeClass UAApp.BaseComponent.AndroidBaseTest.configureAppium
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Yesterday it is working fine.

Expected Behavior

it should start execution.

Minimal Reproducible Example

@test
public void startTest(){
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName", "oneplus7");
caps.setCapability("platformVersion", "12");
caps.setCapability("ignoreHiddenApiPolicyError" , true);
caps.setCapability("app", System.getProperty("user.dir") + "/src/test/java/resources/UA_QA_APP.apk");
caps.setCapability("automationName", "UiAutomator2");
driver = new AndroidDriver(new URI("http://127.0.0.1:4723").toURL(), caps);
}

Environment

  • Operating system: Windows 11
  • Appium server version (output of appium --version):2.5.1
  • Appium driver(s) and their version(s):
  • Appium plugin(s) and their version(s):
  • Node.js version (output of node --version):
  • npm version (output of npm --version):
  • Last component(s) version which did not exhibit the problem:
  • Platform and version under test:
  • Real device or emulator/simulator:

Link to Appium Logs

No response

Further Information

No response

Please attach the full appium server log

Today i am not able to start the server via my code

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: 's-ASUS-A23', ip: '192.168.1.6'
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:536)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:268)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:161)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:90)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:102)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:109)

Hi @ANSHUL786
I just had the same issue on my side and solved it by updating the appium java-client from v9.2.0 to v9.2.1. 🙂

@simonberner -- The latest version of java client is 9.2.0...where did you get 9.2.1 from?

I am seeing the exact same issue as well. Updated Appium to 2.5.1 and also updated Java client to 9.2.0. Any help in fixing this issue is greatly appreciated

UPDATE: appium java-client from v9.2.0 to v9.2.1 did the trick. But I am still puzzled about how do we know to use 9.2.1 when maven website only shows 9.2.0 as latest: https://mvnrepository.com/artifact/io.appium/java-client

hit the same error with 9.2.0 using selenium 4.19. After explicitly specifying the selenium version to 4.18.1, this issue get fixed. Maybe selenium 4.19 changes causing the problem? https://github.com/SeleniumHQ/selenium/blob/acd9d0e77dc5a5a39c3a95a5aa0e94a6c4161fe7/java/CHANGELOG#L1 @KazuCocoa

@simonberner -- The latest version of java client is 9.2.0...where did you get 9.2.1 from?

@sanjaneya-chwy see https://github.com/appium/java-client/releases

I am still having this issue using java-client 9.2.2 and selenium-java 4.19.0.

And I am sure my Appium Server is working as I can connect to it using Appium Inspector using the same capabilities.

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 404. Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Build info: version: '4.19.1', revision: 'abe0ee07dc'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.4.1', java.version: '18.0.2'
Driver info: io.appium.java_client.android.AndroidDriver

an update on this, it turned out the cache was the culprit. after changing to the above combination and reloading the mavin project fixed the issue.