appium / appium/java-client

io.appium.uiautomator2.common.exceptions.NoSuchDriverException

Open
#2,156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

Yesterday it is working fine. But today I am getting error message

org.openqa.selenium.NoSuchSessionException: The session identified by 29d06f45-a489-44de-a010-dfa411eb8d3e is not known
Build info: version: '4.19.1', revision: 'abe0ee07dc'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.2'

Environment

  • Java client build version : 9.2.1
  • Appium server version: 2.3.0
  • Desktop OS/version used to run Appium: Windows 10
  • Node.js version : v18.18.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Moto Edge 30

Code To Reproduce Issue [ Good To Have ]

public class AppTest {
    @AndroidFindBy(accessibility = "open menu")
    private WebElement webElementOpenMenu;

    @Test
    public void demaoTest() {
        AppiumDriverLocalService appiumDriverLocalService = null;
        AppiumDriver appiumDriver = null;
        try {
            appiumDriverLocalService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
                    .withIPAddress("127.0.0.1")
                    .usingPort(4723)
                    .withArgument(GeneralServerFlag.RELAXED_SECURITY)
                    .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                    .withArgument(GeneralServerFlag.USE_DRIVERS, "uiautomator2")
                    .withArgument(GeneralServerFlag.BASEPATH, "/wd/hub/")
                    .withArgument(GeneralServerFlag.LOG_LEVEL, "info:debug")
                    .withTimeout(Duration.ofSeconds(180)));
            appiumDriverLocalService.start();

            UiAutomator2Options uiAutomator2Options = new UiAutomator2Options()
                    .setAutomationName(AutomationName.ANDROID_UIAUTOMATOR2)
                    .setApp(System.getProperty("user.dir" + File.separator + "app" + File.separator + "android" + File.separator + "Android-MyDemoAppRN.1.3.0.build-244.apk"))
                    .setFullReset(false)
                    .setNoReset(true)
                    .setPlatformName("android")
                    .setPlatformVersion("13")
                    .setUdid("ZD222CJSXB")
                    .setAppPackage("com.saucelabs.mydemoapp.rn")
                    .setAppActivity("com.saucelabs.mydemoapp.rn.MainActivity");

            appiumDriver = new AndroidDriver(appiumDriverLocalService.getUrl(), uiAutomator2Options);
            PageFactory.initElements(new AppiumFieldDecorator(appiumDriver, Duration.ofSeconds(30)), this);

            webElementOpenMenu.click();
        } finally {
            appiumDriver.quit();
            appiumDriverLocalService.stop();
        }
    }
}

Link To Appium Logs

Please find the complete log:
https://gist.github.com/dipakkumar1225/0d5ddc800282375d9cb77b6468d62af1

Log for the above attached sample code:
https://gist.github.com/dipakkumar1225/5401087916d0cbb83b6f1ed9c3b31638

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Java reproduction with the stated Java client, Appium server, Windows, and Android environment. Inspect both linked Appium logs to determine why the session is no longer known; done means identifying a reproducible cause and validating a corrective change or regression coverage, though the payload names no repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.