Cant get any element after changing context to webview

okay i changed to - .withArgument(()->"–relaxed-security=chromedriver_autodownload")

but even with this, i got the same error - Automated Chromedriver download is disabled. Use ‘chromedriver_autodownload’ server feature to enable it

try terminal command if it will work? so we narrow issue…
BTW how you installed appium? with npm command?

you need something in code like

    server = new AppiumServiceBuilder()
            .withAppiumJS(new File("//usr//local//lib//node_modules//appium//build//lib//main.js"))
            .withIPAddress(ipAddress)
            .usingPort(Integer.parseInt(port))
            .withLogFile(new File("appium.log"))
            .withTimeout(Duration.ofSeconds(30))
            .withArgument(()->"--relaxed-security")
            .withArgument(()->"--allow-insecure","chromedriver_autodownload")
             // or below
            // .withArgument(()->"--allow-insecure=chromedriver_autodownload")
            .build();

nifargo@dmedvediev-mbp web-app-framework-qa-ui-tests % appium --log-level debug --port 4723 --keep-alive-timeout 1800 --session-override --log-timestamp --use-plugins execute-driver --relaxed-security --allow-insecure=chromedriver_autodownload
2023-10-05 10:29:24:344 - [Appium] Welcome to Appium v2.1.3
2023-10-05 10:29:24:345 - [Appium] Non-default server args:
2023-10-05 10:29:24:346 - [Appium] {
2023-10-05 10:29:24:346 - [Appium] allowInsecure: [
2023-10-05 10:29:24:346 - [Appium] ‘chromedriver_autodownload’
2023-10-05 10:29:24:346 - [Appium] ],
2023-10-05 10:29:24:346 - [Appium] keepAliveTimeout: 1800,
2023-10-05 10:29:24:347 - [Appium] logTimestamp: true,
2023-10-05 10:29:24:347 - [Appium] relaxedSecurityEnabled: true,
2023-10-05 10:29:24:347 - [Appium] sessionOverride: true,
2023-10-05 10:29:24:347 - [Appium] usePlugins: [
2023-10-05 10:29:24:347 - [Appium] ‘execute-driver’
2023-10-05 10:29:24:347 - [Appium] ]
2023-10-05 10:29:24:347 - [Appium] }
2023-10-05 10:29:24:347 - [Appium] Attempting to load driver uiautomator2…
2023-10-05 10:29:24:350 - [debug] [Appium] Requiring driver at /Users/nifargo/.appium/node_modules/appium-uiautomator2-driver
2023-10-05 10:29:24:934 - [Appium] Attempting to load driver xcuitest…
2023-10-05 10:29:24:935 - [debug] [Appium] Requiring driver at /Users/nifargo/.appium/node_modules/appium-xcuitest-driver
2023-10-05 10:29:25:606 - [Appium] Appium REST http interface listener started on http://0.0.0.0:4723
2023-10-05 10:29:25:606 - [Appium] You can provide the following URLs in your client code to connect to this server:
2023-10-05 10:29:25:607 - [Appium] http://127.0.0.1:4723/ (only accessible from the same host)
2023-10-05 10:29:25:607 - [Appium] http://192.168.1.32:4723/
2023-10-05 10:29:25:607 - [Appium] Available drivers:
2023-10-05 10:29:25:607 - [Appium] - [email protected] (automationName ‘UiAutomator2’)
2023-10-05 10:29:25:607 - [Appium] - [email protected] (automationName ‘XCUITest’)
2023-10-05 10:29:25:607 - [Appium] No plugins have been installed. Use the “appium plugin” command to install the one(s) you want to use.

Looks like everything is the same as it was for you.

And yes with npm

so try it it works if you start appium in terminal first.

okay so now i dont have a msg - Automated Chromedriver download is disabled. Use ‘chromedriver_autodownload’ server feature to enable it

But I still have an error - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 117.0.5938.149 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

So .withArgument(()->"–allow-insecure=chromedriver_autodownload") didn’t help with version of chromedriver

here is more info about it

2023-10-05 10:38:38:575 - [debug] [AndroidDriver] Found 1 webview: [“WEBVIEW_com.dkveuroservice.mobileappkit”]
2023-10-05 10:38:38:575 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Available contexts: [“NATIVE_APP”,“WEBVIEW_com.dkveuroservice.mobileappkit”]
2023-10-05 10:38:38:575 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Connecting to chrome-backed webview context ‘WEBVIEW_com.dkveuroservice.mobileappkit’
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] A port was not given, using random free port: 8009
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Passing web view details to the Chromedriver constructor: {
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “info”: {
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “Android-Package”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “Browser”: “Chrome/103.0.5060.71”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “Protocol-Version”: “1.3”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “User-Agent”: “Mozilla/5.0 (Linux; Android 13; sdk_gphone64_arm64 Build/TE1A.220922.021; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.71 Mobile Safari/537.36”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “V8-Version”: “10.3.174.18”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “WebKit-Version”: “537.36 (@7bc4a898d4098652a6425071c780f10ed0441755)”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “webSocketDebuggerUrl”: “ws://127.0.0.1:10900/devtools/browser”
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] },
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “process”: {
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “name”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] “id”: “11880”
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] }
2023-10-05 10:38:38:587 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] }
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] Precalculated Chromedriver capabilities: {
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] “androidPackage”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] “androidUseRunningApp”: true,
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] “androidProcess”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] “androidDeviceSerial”: “emulator-5554”
2023-10-05 10:38:38:589 - [debug] [AndroidDriver] }
2023-10-05 10:38:38:589 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Before starting chromedriver, androidPackage is ‘com.dkveuroservice.mobileappkit’
2023-10-05 10:38:38:590 - [debug] [Chromedriver@b33c] Changed state to ‘starting’
2023-10-05 10:38:38:590 - [debug] [Chromedriver@b33c] Using the static Chromedriver->Chrome mapping
2023-10-05 10:38:38:591 - [debug] [Chromedriver@b33c] The most recent known Chrome version: 114.0.5735
2023-10-05 10:38:38:594 - [debug] [Chromedriver@b33c] Found 2 executables in ‘/Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac’
2023-10-05 10:38:38:611 - [debug] [Chromedriver@b33c] The following Chromedriver executables were found:
2023-10-05 10:38:38:611 - [debug] [Chromedriver@b33c] ‘/Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac_arm64_v114.0.5735.90’ (version ‘114.0.5735.90’, minimum Chrome version ‘114.0.5735’)
2023-10-05 10:38:38:611 - [debug] [Chromedriver@b33c] ‘/Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_m1_v103.0.5060.24’ (version ‘103.0.5060.24’, minimum Chrome version ‘103’)
2023-10-05 10:38:38:611 - [Chromedriver@b33c] Found 1 Chromedriver, which is missing in the list of known versions: {“103.0.5060.24”:“103”}
2023-10-05 10:38:38:612 - [Chromedriver@b33c] No mapping path provided
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] Browser version in the supplied details: Chrome/103.0.5060.71
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] Found Chrome bundle ‘undefined’ version ‘103.0.5060’
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] Found 1 executable capable of automating Chrome ‘103.0.5060’.
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] Choosing the most recent, ‘/Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_m1_v103.0.5060.24’.
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] If a specific version is required, specify it with the chromedriverExecutabledesired capability.
2023-10-05 10:38:38:612 - [Chromedriver@b33c] Set chromedriver binary as: /Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_m1_v103.0.5060.24
2023-10-05 10:38:38:612 - [debug] [Chromedriver@b33c] Killing any old chromedrivers, running: pkill -15 -f “/Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_m1_v103.0.5060.24.*–port=8009”
2023-10-05 10:38:38:639 - [Chromedriver@b33c] No old chromedrivers seem to exist
2023-10-05 10:38:38:639 - [debug] [Chromedriver@b33c] Cleaning this device’s adb forwarded port socket connections: emulator-5554
2023-10-05 10:38:38:639 - [debug] [ADB] List forwarding ports
2023-10-05 10:38:38:640 - [debug] [ADB] Running ‘/Users/nifargo/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --list’
2023-10-05 10:38:38:651 - [Chromedriver@b33c] Spawning chromedriver with: /Users/nifargo/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_m1_v103.0.5060.24 --port=8009 --adb-port=5037 --verbose
2023-10-05 10:38:38:658 - [debug] [Chromedriver@b33c] ChromeDriver version: ‘103.0.5060.24’
2023-10-05 10:38:38:659 - [debug] [Chromedriver@b33c] Matched ‘/status’ to command name ‘getStatus’
2023-10-05 10:38:38:659 - [debug] [Chromedriver@b33c] Proxying [GET /status] to [GET http://127.0.0.1:8009/status] with no body
2023-10-05 10:38:38:660 - [Chromedriver@b33c] connect ECONNREFUSED 127.0.0.1:8009
2023-10-05 10:38:38:862 - [debug] [Chromedriver@b33c] Matched ‘/status’ to command name ‘getStatus’
2023-10-05 10:38:38:862 - [debug] [Chromedriver@b33c] Proxying [GET /status] to [GET http://127.0.0.1:8009/status] with no body
2023-10-05 10:38:38:870 - [debug] [Chromedriver@b33c] Got response with status 200: {“value”:{“build”:{“version”:“103.0.5060.24 (e47b049c438cd0a74dc95a011fceb27db18cb080-refs/branch-heads/5060@{#232})”},“message”:“ChromeDriver ready for new sessions.”,“os”:{“arch”:“arm64”,“name”:“Mac OS X”,“version”:“13.5.1”},“ready”:true}}
2023-10-05 10:38:38:870 - [Chromedriver@b33c] Starting W3C Chromedriver session with capabilities: {
2023-10-05 10:38:38:870 - [Chromedriver@b33c] “capabilities”: {
2023-10-05 10:38:38:870 - [Chromedriver@b33c] “alwaysMatch”: {
2023-10-05 10:38:38:870 - [Chromedriver@b33c] “goog:chromeOptions”: {
2023-10-05 10:38:38:870 - [Chromedriver@b33c] “androidPackage”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:870 - [Chromedriver@b33c] “androidUseRunningApp”: true,
2023-10-05 10:38:38:871 - [Chromedriver@b33c] “androidProcess”: “com.dkveuroservice.mobileappkit”,
2023-10-05 10:38:38:871 - [Chromedriver@b33c] “androidDeviceSerial”: “emulator-5554”
2023-10-05 10:38:38:871 - [Chromedriver@b33c] },
2023-10-05 10:38:38:871 - [Chromedriver@b33c] “goog:loggingPrefs”: {
2023-10-05 10:38:38:871 - [Chromedriver@b33c] “browser”: “ALL”
2023-10-05 10:38:38:871 - [Chromedriver@b33c] }
2023-10-05 10:38:38:871 - [Chromedriver@b33c] }
2023-10-05 10:38:38:871 - [Chromedriver@b33c] }
2023-10-05 10:38:38:871 - [Chromedriver@b33c] }
2023-10-05 10:38:38:871 - [debug] [Chromedriver@b33c] Matched ‘/session’ to command name ‘createSession’
2023-10-05 10:38:38:871 - [debug] [Chromedriver@b33c] Proxying [POST /session] to [POST http://127.0.0.1:8009/session] with body: {“capabilities”:{“alwaysMatch”:{“goog:chromeOptions”:{“androidPackage”:“com.dkveuroservice.mobileappkit”,“androidUseRunningApp”:true,“androidProcess”:“com.dkveuroservice.mobileappkit”,“androidDeviceSerial”:“emulator-5554”},“goog:loggingPrefs”:{“browser”:“ALL”}}}}
2023-10-05 10:38:38:995 - [debug] [Chromedriver@b33c] Webview version: ‘Chrome/103.0.5060.71’
2023-10-05 10:38:39:011 - [debug] [Chromedriver@b33c] Got response with status 200: {“value”:{“capabilities”:{“acceptInsecureCerts”:false,“browserName”:“chrome”,“browserVersion”:“103.0.5060.71”,“chrome”:{“chromedriverVersion”:“103.0.5060.24 (e47b049c438cd0a74dc95a011fceb27db18cb080-refs/branch-heads/5060@{#232})”},“goog:chromeOptions”:{“debuggerAddress”:“localhost:65311”},“pageLoadStrategy”:“normal”,“platformName”:“android”,“proxy”:{},“setWindowRect”:false,“strictFileInteractability”:false,“timeouts”:{“implicit”:0,“pageLoad”:300000,“script”:30000},“unhandledPromptBehavior”:“dismiss and notify”,“webauthn:extension:credBlob”:false,“webauthn:extension:largeBlob”:false,“webauthn:virtualAuthenticators”:false},“sessionId”:“5709edd81231bad17fccdccddbd24b64”}}
2023-10-05 10:38:39:011 - [Chromedriver@b33c] Determined the downstream protocol as ‘W3C’
2023-10-05 10:38:39:012 - [debug] [Chromedriver@b33c (5709edd8)] Changed state to ‘online’
2023-10-05 10:38:39:012 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Responding to client with driver.setContext() result: null
2023-10-05 10:38:39:012 - [HTTP] <-- POST /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/context 200 541 ms - 14
2023-10-05 10:38:39:012 - [HTTP]
2023-10-05 10:38:39:014 - [HTTP] --> GET /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/context
2023-10-05 10:38:39:014 - [HTTP] {}
2023-10-05 10:38:39:014 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Calling AppiumDriver.getCurrentContext() with args: [“c4d330b4-b030-4877-97d2-52a6f62aa5b0”]
2023-10-05 10:38:39:015 - [debug] [AndroidUiautomator2Driver@32a5 (c4d330b4)] Responding to client with driver.getCurrentContext() result: “WEBVIEW_com.dkveuroservice.mobileappkit”
2023-10-05 10:38:39:015 - [HTTP] <-- GET /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/context 200 1 ms - 51
2023-10-05 10:38:39:015 - [HTTP]
2023-10-05 10:38:39:017 - [HTTP] --> GET /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/source
2023-10-05 10:38:39:017 - [HTTP] {}
2023-10-05 10:38:39:017 - [AndroidUiautomator2Driver@32a5 (c4d330b4)] Driver proxy active, passing request on via HTTP proxy
2023-10-05 10:38:39:018 - [debug] [Chromedriver@b33c (5709edd8)] Matched ‘/session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/source’ to command name ‘getPageSource’
2023-10-05 10:38:39:018 - [debug] [Chromedriver@b33c (5709edd8)] Proxying [GET /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/source] to [GET http://127.0.0.1:8009/session/5709edd81231bad17fccdccddbd24b64/source] with no body
2023-10-05 10:38:39:028 - [debug] [Chromedriver@b33c (5709edd8)] Got response with status 200: {“value”:""}
2023-10-05 10:38:39:028 - [HTTP] <-- GET /session/c4d330b4-b030-4877-97d2-52a6f62aa5b0/source 200 12 ms - 51
2023-10-05 10:38:39:028 - [HTTP]
2023-10-05 10:39:31:594 - [HTTP] --> GET /session/8689df33-249d-4fd8-9293-0e6e2f06d8b1/timeouts
2023-10-05 10:39:31:595 - [HTTP] {}
2023-10-05 10:39:31:596 - [debug] [AppiumDriver@5f48] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started

what timeout you have? you successfully connected now. we see this in logs. After 1 min of no command you got disconnected. Increase in caps

capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 180);

i have it even more
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 500);

so you send command get page source. received empty response :slight_smile: and after about 50 sec have timeout. Something like this. Try search something now… findElement…

okay i created a method to get text

    WebElement feedbackWebTitle = new ChromeDriver().findElement(By.cssSelector("#title"));
    return feedbackWebTitle.getText();

i still get error
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 117.0.5938.149 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

and i find this in the log:
[debug] [Chromedriver@dc44] Got response with status 200: {“value”:{“build”:{“version”:“103.0.5060.24 (e47b049c438cd0a74dc95a011fceb27db18cb080-refs/branch-heads/5060@{#232})”},“message”:“ChromeDriver ready for new sessions.”,“os”:{“arch”:“arm64”,“name”:“Mac OS X”,“version”:“13.5.1”},“ready”:true}}
2023-10-05 11:30:41:385 - [Chromedriver@dc44] Starting W3C Chromedriver session with capabilities: {
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “capabilities”: {
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “alwaysMatch”: {
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “goog:chromeOptions”: {
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “androidPackage”: “com.dkveuroservice.mobileappkit”,
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “androidUseRunningApp”: true,
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “androidProcess”: “com.dkveuroservice.mobileappkit”,
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “androidDeviceSerial”: “emulator-5554”
2023-10-05 11:30:41:385 - [Chromedriver@dc44] },
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “goog:loggingPrefs”: {
2023-10-05 11:30:41:385 - [Chromedriver@dc44] “browser”: “ALL”
2023-10-05 11:30:41:386 - [Chromedriver@dc44] }
2023-10-05 11:30:41:386 - [Chromedriver@dc44] }
2023-10-05 11:30:41:386 - [Chromedriver@dc44] }
2023-10-05 11:30:41:386 - [Chromedriver@dc44] }
2023-10-05 11:30:41:386 - [debug] [Chromedriver@dc44] Matched ‘/session’ to command name ‘createSession’
2023-10-05 11:30:41:386 - [debug] [Chromedriver@dc44] Proxying [POST /session] to [POST http://127.0.0.1:8010/session] with body: {“capabilities”:{“alwaysMatch”:{“goog:chromeOptions”:{“androidPackage”:“com.dkveuroservice.mobileappkit”,“androidUseRunningApp”:true,“androidProcess”:“com.dkveuroservice.mobileappkit”,“androidDeviceSerial”:“emulator-5554”},“goog:loggingPrefs”:{“browser”:“ALL”}}}}
2023-10-05 11:30:41:517 - [debug] [Chromedriver@dc44] Webview version: ‘Chrome/103.0.5060.71’
2023-10-05 11:30:41:537 - [debug] [Chromedriver@dc44] Got response with status 200: {“value”:{“capabilities”:{“acceptInsecureCerts”:false,“browserName”:“chrome”,“browserVersion”:“103.0.5060.71”,“chrome”:{“chromedriverVersion”:“103.0.5060.24 (e47b049c438cd0a74dc95a011fceb27db18cb080-refs/branch-heads/5060@{#232})”},“goog:chromeOptions”:{“debuggerAddress”:“localhost:52932”},“pageLoadStrategy”:“normal”,“platformName”:“android”,“proxy”:{},“setWindowRect”:false,“strictFileInteractability”:false,“timeouts”:{“implicit”:0,“pageLoad”:300000,“script”:30000},“unhandledPromptBehavior”:“dismiss and notify”,“webauthn:extension:credBlob”:false,“webauthn:extension:largeBlob”:false,“webauthn:virtualAuthenticators”:false},“sessionId”:“cf719909d3e6437e36a3193ec89e5fb1”}}
2023-10-05 11:30:41:538 - [Chromedriver@dc44] Determined the downstream protocol as ‘W3C’
2023-10-05 11:30:41:538 - [debug] [Chromedriver@dc44 (cf719909)] Changed state to ‘online’
2023-10-05 11:30:41:539 - [debug] [AndroidUiautomator2Driver@cbfc (7b7fdb29)] Responding to client with driver.setContext() result: null
2023-10-05 11:30:41:539 - [HTTP] <-- POST /session/7b7fdb29-971b-4ded-a3a2-004be584b7a4/context 200 531 ms - 14
2023-10-05 11:30:41:539 - [HTTP]
2023-10-05 11:30:41:541 - [HTTP] --> GET /session/7b7fdb29-971b-4ded-a3a2-004be584b7a4/context
2023-10-05 11:30:41:541 - [HTTP] {}
2023-10-05 11:30:41:541 - [debug] [AndroidUiautomator2Driver@cbfc (7b7fdb29)] Calling AppiumDriver.getCurrentContext() with args: [“7b7fdb29-971b-4ded-a3a2-004be584b7a4”]
2023-10-05 11:30:41:542 - [debug] [AndroidUiautomator2Driver@cbfc (7b7fdb29)] Responding to client with driver.getCurrentContext() result: “WEBVIEW_com.dkveuroservice.mobileappkit”
2023-10-05 11:30:41:542 - [HTTP] <-- GET /session/7b7fdb29-971b-4ded-a3a2-004be584b7a4/context 200 1 ms - 51
2023-10-05 11:30:41:542 - [HTTP]
2023-10-05 11:31:28:186 - [HTTP] --> GET /session/8689df33-249d-4fd8-9293-0e6e2f06d8b1/timeouts
2023-10-05 11:31:28:186 - [HTTP] {}
2023-10-05 11:31:28:189 - [debug] [AppiumDriver@217c] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started

out of ideas :frowning: try here -> https://github.com/appium/appium/issues

1 Like

thank you so much for everything)

i found the way to fix the problem - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 117.0.5938.149 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

I used the command - brew install chromedriver
and now I don’t have a problem with chromedriver

but I faced with situation when context is changed - okay, driver is selected - okay. Opened empty chromebrowser - with data:, in the searching field

well at least minus one more problem.

Last sentence not clear…

BTW you may just close ticket on git without waiting that Appium team will do it.

also check -> https://github.com/appium/appium-uiautomator2-driver#elements-cannot-be-found

i undertood that empty browser i got if i use New ChromeDriver() in the method

if u se Appium driver i dont have any browser at all.
public String getFeedbackWebTitl() {
WebDriverWait wait = new WebDriverWait(AppiumInit.getAppiumDriver(), Duration.ofSeconds(10)); // Параметр “30” - це таймаут очікування в секундах
wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#title")));

    WebElement feedbackWebTitle = AppiumInit.getAppiumDriver().findElement(By.cssSelector("#title"));
    return feedbackWebTitle.getText();
}

but still cant catch this element. will check your URL

o and BTW - closed all tickets as you told me

try now get page source or if lucky html tree with commands i mentioned before…

unfortunatelly i didn’t get anything

NATIVE_APP
WEBVIEW_com.dkveuroservice.mobileappkit
Found contexts size: ‘2’
Found context: ‘NATIVE_APP’
Found context: ‘WEBVIEW_com.dkveuroservice.mobileappkit’
Switching context to: ‘WEBVIEW_com.dkveuroservice.mobileappkit’
Current Context: WEBVIEW_com.dkveuroservice.mobileappkit
**<html><head></head><body></body></html>**

org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //span[@id=‘title’] (tried for 10 second(s) with 500 milliseconds interval)
Build info: version: ‘4.10.0’, revision: ‘c14d967899’
System info: os.name: ‘Mac OS X’, os.arch: ‘aarch64’, os.version: ‘13.5.1’, java.version: ‘17.0.6’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appium:app: //Users//nifargo//Documents…, appium:appActivity: com.dkveuroservice.mobileap…, appium:appPackage: com.dkveuroservice.mobileap…, appium:automationName: UiAutomator2, appium:chromedriverExecutable: /Users/nifargo/Downloads/ch…, appium:databaseEnabled: false, appium:desired: {app: //Users//nifargo//Documents…, appActivity: com.dkveuroservice.mobileap…, appPackage: com.dkveuroservice.mobileap…, automationName: UiAutomator2, chromedriverExecutable: /Users/nifargo/Downloads/ch…, deviceName: autoTests, newCommandTimeout: 800, platformName: ANDROID}, appium:deviceApiLevel: 33, appium:deviceManufacturer: Google, appium:deviceModel: sdk_gphone64_arm64, appium:deviceName: emulator-5554, appium:deviceScreenDensity: 560, appium:deviceScreenSize: 1440x2560, appium:deviceUDID: emulator-5554, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: true, appium:newCommandTimeout: 800, appium:pixelRatio: 3.5, appium:platformVersion: 13, appium:statBarHeight: 84, appium:takesScreenshot: true, appium:viewportRect: {height: 2392, left: 0, top: 84, width: 1440}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: ANDROID}
Session ID: 65380796-b4aa-4568-b319-71a0d5913316

at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:84)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:230)
at common.AppiumActions.find(AppiumActions.java:24)
at org.dkv.feedbackMenuForm.FeedbackProfilePage.getFeedbackWebTitle(FeedbackProfilePage.java:47)
at org.dkvProject.profilePageProject.FeedbackTest.ProfileAppFeedbackFlow(FeedbackTest.java:69)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

can you at least find this?

PS open this page. give at least 5-10 sec pause for sure. and try find this element.

Better use findElements! cause the nyou can easily check it size > 0.

NATIVE_APP
WEBVIEW_com.dkveuroservice.mobileappkit
Found contexts size: ‘2’
Found context: ‘NATIVE_APP’
Found context: ‘WEBVIEW_com.dkveuroservice.mobileappkit’
Switching context to: ‘WEBVIEW_com.dkveuroservice.mobileappkit’
Current Context: WEBVIEW_com.dkveuroservice.mobileappkit
[[AndroidDriver: on ANDROID (eba5d6a2-6a3a-4679-90a1-be8c61557664)] → css selector: body]

org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //span[@id=‘title’] (tried for 10 second(s) with 500 milliseconds interval)

stop using your waitings…
just simple:

        sleep(5000);
        List<WebElement> bodyEl = driver.findElements(By.cssSelector("body"));
        System.out.println("bodyEl.size: " + bodyEl.size());