appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
454 stars 183 forks source link

I am trying to automate flutter app using flutter finder and java. I am getting unknown locator for each and every flutter element. #712

Closed Maheshbabu78 closed 3 months ago

Maheshbabu78 commented 3 months ago

public class FlutterAutomation {

private static AndroidDriver driver;
private static final String appPath = "C:\\Users\\NMAHESHBABU\\flutterlogin-debug.apk";
private final String deviceName = "Pixel 3 API 29";
private final String testName = "Flutter Automation";

@BeforeTest
public void setUp() throws MalformedURLException {
    DesiredCapabilities flutterCapabilities = new DesiredCapabilities();
    flutterCapabilities.setCapability("deviceName", deviceName);
    flutterCapabilities.setCapability("platformName", "Android");
    flutterCapabilities.setCapability("automationName", "flutter");
    flutterCapabilities.setCapability("app", appPath);
    flutterCapabilities.setCapability("noReset", true);
    flutterCapabilities.setCapability("testName", testName);
    driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), flutterCapabilities);
    System.out.println("Created AppiumDriver");
}

@Test
public void checkLoginFunction() throws InterruptedException {

    FlutterFinder find = new FlutterFinder(driver);
    Thread.sleep(3000);
    FlutterElement txt_username = find.byValueKey("txt_username"); // this is valid locator
    FlutterElement txt_password = find.byValueKey("txt_pass"); // this is not a valid locator actual locator is txt_password
    FlutterElement btn_click = find.byValueKey("button_login");// this is valid locator
    System.out.println(txt_username);
    System.out.println(txt_password);
    txt_username.sendKeys("user@gmail.com");
    txt_password.sendKeys("user123");
    btn_click.click();

}

@AfterTest
public void tearDown() {
    if (driver != null) {
        driver.quit();
    }
}

Output: SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. Created AppiumDriver [io.github.ashwith.flutter.FlutterElement@484658fd -> unknown locator] [io.github.ashwith.flutter.FlutterElement@c26b6255 -> unknown locator] FAILED: checkLoginFunction org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.

Here I am getting unknown locator for valid locator and invalid locator. Using this flutterelement i am not able to differenciate element more over i am not getting nosuchelementfound exception or any other exception. Is it problem with flutter finder or my app??? I taken .apk file from this github url [(https://gitlab.com/pertiatechnologies/flutterapptestautomationpoc)]

KazuCocoa commented 3 months ago

Please attach the full appium server log as well

Maheshbabu78 commented 3 months ago

Thanks for your response. Here i am attaching Please check it and let me know.

[HTTP] Waiting until the server is closed [HTTP] Received server close event [Appium] Welcome to Appium v1.22.3 [Appium] Non-default server args: [Appium] address: 127.0.0.1 [Appium] relaxedSecurityEnabled: true [Appium] allowInsecure: { [Appium] } [Appium] denyInsecure: { [Appium] } [Appium] Appium REST http interface listener started on 127.0.0.1:4723 [HTTP] Request idempotency key: 35d5061c-d592-4c30-a76f-9b1511246e7a [HTTP] --> POST /wd/hub/session [HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"appium:app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","appium:automationName":"flutter","appium:deviceName":"Pixel 3 API 29","appium:noReset":true,"appium:testName":"Flutter Automation","platformName":"ANDROID"}}} [W3C] Calling AppiumDriver.createSession() with args: [null,null,{"firstMatch":[{}],"alwaysMatch":{"appium:app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","appium:automationName":"flutter","appium:deviceName":"Pixel 3 API 29","appium:noReset":true,"appium:testName":"Flutter Automation","platformName":"ANDROID"}}] [BaseDriver] Event 'newSessionRequested' logged at 1719982294350 (10:21:34 GMT+0530 (India Standard Time)) [Appium] Appium v1.22.3 creating new FlutterDriver (v0.0.32) session [Appium] Applying relaxed security to 'FlutterDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [BaseDriver] Creating session with W3C capabilities: { [BaseDriver] "alwaysMatch": { [BaseDriver] "platformName": "ANDROID", [BaseDriver] "appium:app": "C:\Users\NMAHESHBABU\flutterlogin-debug.apk", [BaseDriver] "appium:automationName": "flutter", [BaseDriver] "appium:deviceName": "Pixel 3 API 29", [BaseDriver] "appium:noReset": true, [BaseDriver] "appium:testName": "Flutter Automation" [BaseDriver] }, [BaseDriver] "firstMatch": [ [BaseDriver] {} [BaseDriver] ] [BaseDriver] } [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] app [BaseDriver] testName [BaseDriver] Session created with session id: 791503dd-d6f2-4c7c-bff5-ef2850456dac [FlutterDriver] Starting an Android proxy session [BaseDriver] Creating session with W3C capabilities: { [BaseDriver] "alwaysMatch": { [BaseDriver] "platformName": "ANDROID", [BaseDriver] "appium:app": "C:\Users\NMAHESHBABU\flutterlogin-debug.apk", [BaseDriver] "appium:automationName": "flutter", [BaseDriver] "appium:deviceName": "Pixel 3 API 29", [BaseDriver] "appium:noReset": true, [BaseDriver] "appium:testName": "Flutter Automation" [BaseDriver] }, [BaseDriver] "firstMatch": [ [BaseDriver] {} [BaseDriver] ] [BaseDriver] } [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] testName [BaseDriver] Session created with session id: 4a019829-9ef0-4e45-8fa5-d4cccec5679d [BaseDriver] Using local app 'C:\Users\NMAHESHBABU\flutterlogin-debug.apk' [UiAutomator2] Checking whether app is actually present [ADB] Using 'adb.exe' from 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Using device: emulator-5554 [ADB] Using 'adb.exe' from 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [FlutterDriver] Connection to ws://127.0.0.1:44763/yjNWj_yL6jY=/ws closed [ADB] Setting device id to emulator-5554 [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [ADB] Current device property 'ro.build.version.sdk': 29 [ADB] Getting device platform version [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release' [ADB] Current device property 'ro.build.version.release': 10 [ADB] Device API level: 29 [UiAutomator2] Relaxing hidden api policy [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1'' [AndroidDriver] Parsing package and activity from app manifest [ADB] Package name: 'com.example.flutter_android_1' [ADB] Main activity name: 'com.example.flutter_android_1.MainActivity' [AndroidDriver] Parsed package and activity are: com.example.flutter_android_1/com.example.flutter_android_1.MainActivity [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping' [AndroidDriver] Pushing settings apk to device... [ADB] Getting install status for io.appium.settings [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [ADB] 'io.appium.settings' is installed [ADB] Getting package info for 'io.appium.settings' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.4.0' >= '3.4.0') [ADB] There is no need to install/upgrade 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [ADB] Getting IDs of all 'io.appium.settings' processes [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?'' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)' [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [Logcat] Starting logs capture with command: C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8201 [ADB] Forwarding system: 8201 to device: 6790 [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8201 tcp:6790' [UiAutomator2] Server package at 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk' is not writeable. Will copy it into the temporary location at 'C:\Users\NMAHES~1\AppData\Local\Temp\202463-18488-1f8wsnu.8cob' as a workaround. Consider making this file writeable manually in order to improve the performance of session startup. [UiAutomator2] Server package at 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is not writeable. Will copy it into the temporary location at 'C:\Users\NMAHES~1\AppData\Local\Temp\202463-18488-1f8wsnu.8cob' as a workaround. Consider making this file writeable manually in order to improve the performance of session startup. [ADB] Getting install status for io.appium.uiautomator2.server [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [ADB] 'io.appium.uiautomator2.server' is installed [ADB] Getting package info for 'io.appium.uiautomator2.server' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.27.0' >= '4.27.0') [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [ADB] Checking app cert for C:\Users\NMAHES~1\AppData\Local\Temp\202463-18488-1f8wsnu.8cob\appium-uiautomator2-server-v4.27.0.apk [ADB] Using the previously cached signature entry for 'appium-uiautomator2-server-v4.27.0.apk' [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.27.0.apk' [ADB] Getting install status for io.appium.uiautomator2.server.test [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test' [ADB] 'io.appium.uiautomator2.server.test' is installed [ADB] Checking app cert for C:\Users\NMAHES~1\AppData\Local\Temp\202463-18488-1f8wsnu.8cob\appium-uiautomator2-server-debug-androidTest.apk [ADB] Using the previously cached signature entry for 'appium-uiautomator2-server-debug-androidTest.apk' [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk' [UiAutomator2] Server packages are not going to be (re)installed [UiAutomator2] Waiting up to 30000ms for services to be available [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation' [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available [ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]] [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;' [ADB] Checking app cert for C:\Users\NMAHESHBABU\flutterlogin-debug.apk [ADB] Using the previously cached signature entry for 'flutterlogin-debug.apk' [ADB] Getting install status for com.example.flutter_android_1 [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.example.flutter_android_1' [ADB] 'com.example.flutter_android_1' is installed [ADB] Getting package info for 'com.example.flutter_android_1' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.example.flutter_android_1' [ADB] The version name of the installed 'com.example.flutter_android_1' is greater or equal to the application version name ('1.0.0' >= '1.0.0') [ADB] There is no need to install/upgrade 'C:\Users\NMAHESHBABU\flutterlogin-debug.apk' [UiAutomator2] Performing shallow cleanup of automation leftovers [UiAutomator2] The following obsolete sessions are still running: ["7d9eabae-fd97-4fe6-a241-149fc4956b88"] [UiAutomator2] Cleaning up 1 obsolete session [Instrumentation] . [Instrumentation] Time: 249.13 [Instrumentation] [Instrumentation] OK (1 test) [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test' [Instrumentation] The process has exited with code 0 [UiAutomator2] Starting UIAutomator2 server 4.27.0 [UiAutomator2] Using UIAutomator2 server from 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk' and test from 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' [UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online... [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","-e","disableAnalytics",true,"io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"] [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server: [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] socket hang up [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}} [UiAutomator2] The initialization of the instrumentation process took 8234ms [WD Proxy] Matched '/session' to command name 'createSession' [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8201/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"ANDROID","app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","automationName":"flutter","deviceName":"Pixel 3 API 29","noReset":true,"testName":"Flutter Automation"},"platformName":"ANDROID","app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","automationName":"flutter","deviceName":"emulator-5554","noReset":true,"testName":"Flutter Automation","deviceUDID":"emulator-5554","appPackage":"com.example.flutter_android_1"}],"alwaysMatch":{}}} [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"ANDROID","app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","automationName":"flutter","deviceName":"Pixel 3 API 29","noReset":true,"testName":"Flutter Automation"},"platformName":"ANDROID","app":"C:\Users\NMAHESHBABU\flutterlogin-debug.apk","automationName":"flutter","deviceName":"emulator-5554","noReset":true,"testName":"Flutter Automation","deviceUDID":"emulator-5554","appPackage":"com.example.flutter_android_1"}],"alwaysMatch":{}},"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6"}} [WD Proxy] Determined the downstream protocol as 'W3C' [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8201/wd/hub/session/17c57b98-3400-4dc1-836b-b9a63eaa2cc6/appium/device/info] with no body [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":{"androidId":"e8a4923d8932e7ff","apiVersion":"29","bluetooth":null,"brand":"google","carrierName":"Android","displayDensity":420,"locale":"en_US","manufacturer":"Google","model":"Android SDK built for x86","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidthKbps":1048576,"networkCapabilities":"NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-30,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":null,"isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":0,"subtypeName":"","type":1,"typeName":"WIFI"},{"capabilities":{"SSID":null,"linkDownBandwidthKbps":102400,"linkUpstreamBandwidthKbps":51200,"networkCapabilities":"NET_CAPABILITY... [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window' [AndroidDriver] Screen already unlocked, doing nothing [UiAutomator2] Starting 'com.example.flutter_android_1/com.example.flutter_android_1.MainActivity and waiting for 'com.example.flutter_android_1/com.example.flutter_android_1.MainActivity' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.example.flutter_android_1/com.example.flutter_android_1.MainActivity -S' [ADB] Waiting up to 20000ms for activity matching pkg: 'com.example.flutter_android_1' and activity: 'com.example.flutter_android_1.MainActivity' to be focused [ADB] Possible activities, to be checked: 'com.example.flutter_android_1.MainActivity', 'com.example.flutter_android_1.com.example.flutter_android_1.MainActivity' [ADB] Getting focused package and activity [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window displays' [ADB] Found package: 'com.example.flutter_android_1' and fully qualified activity name : 'com.example.flutter_android_1.MainActivity' [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8201/wd/hub/session/17c57b98-3400-4dc1-836b-b9a63eaa2cc6/appium/device/pixel_ratio] with no body [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":2.625} [WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars' [WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8201/wd/hub/session/17c57b98-3400-4dc1-836b-b9a63eaa2cc6/appium/device/system_bars] with no body [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":{"statusBar":63}} [WD Proxy] Matched '/window/current/size' to command name 'getWindowSize' [WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8201/wd/hub/session/17c57b98-3400-4dc1-836b-b9a63eaa2cc6/window/current/size] with no body [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":{"height":1794,"width":1080}} [ADB] Using 'adb.exe' from 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe' [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Using device: emulator-5554 [FlutterDriver] C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:44525 tcp:44525 [FlutterDriver] Attempt #1 [FlutterDriver] Connecting to Dart Observatory: ws://127.0.0.1:44525/P9ip9lCRfmU=/ws [FlutterDriver] Connected to ws://127.0.0.1:44525/P9ip9lCRfmU=/ws [FlutterDriver] Listing all isolates: [{"type":"@Isolate","id":"isolates/233373185133667","name":"main","number":"233373185133667","isSystemIsolate":false}] [Appium] New FlutterDriver session created successfully, session 791503dd-d6f2-4c7c-bff5-ef2850456dac added to master session list [BaseDriver] Event 'newSessionStarted' logged at 1719982337435 (10:22:17 GMT+0530 (India Standard Time)) [W3C (791503dd)] Cached the protocol value 'W3C' for the new session 791503dd-d6f2-4c7c-bff5-ef2850456dac [W3C (791503dd)] Responding to client with driver.createSession() result: {"capabilities":{"shell":false,"allowCors":false,"reboot":false,"ipa":null,"address":"127.0.0.1","port":4723,"basePath":"/wd/hub","keepAliveTimeout":null,"callbackAddress":null,"callbackPort":null,"bootstrapPort":4724,"backendRetries":3,"sessionOverride":false,"launch":false,"logFile":null,"loglevel":"debug","logTimestamp":false,"localTimezone":false,"logNoColors":false,"webhook":null,"safari":false,"defaultDevice":false,"forceIphone":false,"forceIpad":false,"automationTraceTemplatePath":null,"instrumentsPath":null,"nodeconfig":null,"robotAddress":"0.0.0.0","robotPort":-1,"chromedriverExecutable":null,"showConfig":false,"noPermsCheck":false,"enforceStrictCaps":false,"isolateSimDevice":false,"tmpDir":"C:\Users\NMAHES~1\AppData\Local\Temp","traceDir":null,"debugLogSpacing":false,"suppressKillServer":false,"longStacktrace":false,"webkitDebugProxyPort":27753,"wdaLocalPort":8100,"defaultCapabilities":{},"relaxedSecurityEnabled":true,"allowInsecure":[],"denyInsecure":[],"defaultCommandTimeout":60,"keepArtif... [HTTP] <-- POST /wd/hub/session 200 43095 ms - 2136 [HTTP] [HTTP] --> POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF91c2VybmFtZSIsImZpbmRlclR5cGUiOiJCeVZhbHVlS2V5In0%3D/value [HTTP] {"id":"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF91c2VybmFtZSIsImZpbmRlclR5cGUiOiJCeVZhbHVlS2V5In0=","text":"user@gmail.com","value":["u","s","e","r","@","g","m","a","i","l",".","c","o","m"]} [W3C (791503dd)] Calling AppiumDriver.setValue() with args: [["u","s","e","r","@","g","m","a","i","l",".","c","o","m"],"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF91c2VybmFtZSIsImZpbmRlclR5cGUiOiJCeVZhbHVlS2V5In0=","791503dd-d6f2-4c7c-bff5-ef2850456dac"] [FlutterDriver] Executing Flutter driver command 'setValue' [FlutterDriver] >>> {"command":"tap","keyValueType":"String","keyValueString":"txt_username","finderType":"ByValueKey"} [FlutterDriver] <<< {"isError":false,"response":{},"type":"_extensionType","method":"ext.flutter.driver"} | previous command tap [W3C (791503dd)] Responding to client with driver.setValue() result: null [HTTP] <-- POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF91c2VybmFtZSIsImZpbmRlclR5cGUiOiJCeVZhbHVlS2V5In0%3D/value 200 227 ms - 14 [HTTP] [HTTP] --> POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ%3D%3D/value [HTTP] {"id":"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ==","text":"user123","value":["u","s","e","r","1","2","3"]} [W3C (791503dd)] Calling AppiumDriver.setValue() with args: [["u","s","e","r","1","2","3"],"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ==","791503dd-d6f2-4c7c-bff5-ef2850456dac"] [FlutterDriver] Executing Flutter driver command 'setValue' [FlutterDriver] >>> {"command":"tap","keyValueType":"String","keyValueString":"txt_pass","finderType":"ByValueKey"} [HTTP] <-- POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ%3D%3D/value - - ms - - [HTTP] [HTTP] --> DELETE /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac [HTTP] {} [W3C (791503dd)] Calling AppiumDriver.deleteSession() with args: ["791503dd-d6f2-4c7c-bff5-ef2850456dac"] [BaseDriver] Event 'quitSessionRequested' logged at 1719982461606 (10:24:21 GMT+0530 (India Standard Time)) [Appium] Removing session 791503dd-d6f2-4c7c-bff5-ef2850456dac from our master session list [FlutterDriver] Deleting Flutter Driver session [UiAutomator2] Deleting UiAutomator2 session [UiAutomator2] Deleting UiAutomator2 server session [WD Proxy] Matched '/' to command name 'deleteSession' [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8201/wd/hub/session/17c57b98-3400-4dc1-836b-b9a63eaa2cc6] with no body [WD Proxy] Got response with status 200: {"sessionId":"17c57b98-3400-4dc1-836b-b9a63eaa2cc6","value":null} [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.example.flutter_android_1' [FlutterDriver] Connection to ws://127.0.0.1:44525/P9ip9lCRfmU=/ws closed [Instrumentation] . [Logcat] Stopping logcat capture [ADB] Removing forwarded port socket connection: 8201 [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8201' [Instrumentation] Time: 139.494 [Instrumentation] [Instrumentation] OK (1 test) [UiAutomator2] Restoring hidden api policy to the device default configuration [ADB] Running 'C:\Users\NMAHESHBABU\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' [Instrumentation] The process has exited with code 0 [BaseDriver] Event 'quitSessionFinished' logged at 1719982464357 (10:24:24 GMT+0530 (India Standard Time)) [W3C (791503dd)] Received response: null [W3C (791503dd)] But deleting session, so not returning [W3C (791503dd)] Responding to client with driver.deleteSession() result: null [HTTP] <-- DELETE /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac 200 2754 ms - 14 [HTTP]

KazuCocoa commented 3 months ago

Around here...?

[HTTP] --> POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ%3D%3D/value
[HTTP] {"id":"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ==","text":"user123","value":["u","s","e","r","1","2","3"]}
[W3C (791503dd)] Calling AppiumDriver.setValue() with args: [["u","s","e","r","1","2","3"],"eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ==","791503dd-d6f2-4c7c-bff5-ef2850456dac"]
[FlutterDriver] Executing Flutter driver command 'setValue'
[FlutterDriver] >>> {"command":"tap","keyValueType":"String","keyValueString":"txt_pass","finderType":"ByValueKey"}
[HTTP] <-- POST /wd/hub/session/791503dd-d6f2-4c7c-bff5-ef2850456dac/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6InR4dF9wYXNzIiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ%3D%3D/value - - ms - -
[HTTP]

I guess the client did not get any response, so the client implementation raised the error.

Them, the issue was maybe no response from the Flutter/DartVM. Possibly the target element should be adjusted

Maheshbabu78 commented 3 months ago

Even I am not getting nosuchelement from flutterdriver as well. Every flutter element I am getting unknown locator. So what is my next step??? Please guide me.

KazuCocoa commented 3 months ago

https://github.com/SeleniumHQ/selenium/blob/5e8d6a1f93c51a719c13d7dc263097bec707b11f/java/src/org/openqa/selenium/remote/RemoteWebElement.java#L378

Maybe here? So, for me, it looks like the FlutterElement author didn't override the toString so System.out.println(txt_username); print the message. Please ask the author to override that.

Maheshbabu78 commented 3 months ago

Thank you very much @KazuCocoa