Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
ANSHUL786 opened this issue Mar 28, 2024 · 13 comments

Comments

@ANSHUL786
Copy link

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

@ANSHUL786 ANSHUL786 added the bug label Mar 28, 2024
@ANSHUL786 ANSHUL786 changed the title org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. bug: <title> org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure Mar 28, 2024
@KazuCocoa
Copy link
Member

Please attach the full appium server log

@KazuCocoa KazuCocoa removed the bug label Mar 28, 2024
@mykola-mokhnach mykola-mokhnach transferred this issue from appium/appium Mar 28, 2024
@ANSHUL786
Copy link
Author

ANSHUL786 commented Mar 28, 2024

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)

@simonberner
Copy link

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. 🙂

@sanjaneya-chwy
Copy link

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

@sanjaneya-chwy
Copy link

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

@sanjaneya-chwy
Copy link

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

@valfirst
Copy link
Collaborator

@Jiyvn
Copy link

Jiyvn commented Mar 29, 2024

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

@valfirst
Copy link
Collaborator

@Jiyvn https://github.com/appium/java-client?tab=readme-ov-file#compatibility-matrix

@simonberner
Copy link

@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

@JialiLyv
Copy link

JialiLyv commented Apr 17, 2024

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

@JialiLyv
Copy link

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.

@NehallBaig
Copy link

@ANSHUL786 Please use mentioned below dependencies. I hope your error will be resolved.

io.appium java-client 9.2.2 org.seleniumhq.selenium selenium-remote-driver 4.13.0 org.seleniumhq.selenium selenium-support 4.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants