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
440 stars 179 forks source link

Flutter driver on appium: why some elements can't be clicked #672

Open asma203 opened 3 months ago

asma203 commented 3 months ago

using appium v2.5.1 flutter: flutter@2.4.2 (automationName 'Flutter') why click some elements not clickable specifically [HTTP] [HTTP] --> POST /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/element [HTTP] {"using":"accessibility id","value":"Food\nFood\nUp to 50%"} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.findElement() with args: ["accessibility id","Food\nFood\nUp to 50%","506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'findElement' [XCUITestDriver@2c0d (554aed13)] Executing command 'findElement' [XCUITestDriver@2c0d (554aed13)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector [XCUITestDriver@2c0d (554aed13)] Waiting up to 0 ms for condition [XCUITestDriver@2c0d (554aed13)] Matched '/element' to command name 'findElement' [XCUITestDriver@2c0d (554aed13)] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/5CAACF44-C55A-4EB4-90F9-030BD95A701B/element] with body: {"using":"accessibility id","value":"Food\nFood\nUp to 50%"} [XCUITestDriver@2c0d (554aed13)] Got response with status 200: {"value":{"ELEMENT":"8A000000-0000-0000-D403-000000000000","element-6066-11e4-a52e-4f735466cecf":"8A000000-0000-0000-D403-000000000000"},"sessionId":"5CAACF44-C55A-4EB4-90F9-030BD95A701B"} [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"8A000000-0000-0000-D403-000000000000","ELEMENT":"8A000000-0000-0000-D403-000000000000"} [HTTP] <-- POST /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/element 200 251 ms - 137 [HTTP] [HTTP] --> POST /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/element/8A000000-0000-0000-D403-000000000000/click [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.click() with args: ["8A000000-0000-0000-D403-000000000000","506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'click' [XCUITestDriver@2c0d (554aed13)] Executing command 'click' [XCUITestDriver@2c0d (554aed13)] Matched '/element/8A000000-0000-0000-D403-000000000000/click' to command name 'click' [XCUITestDriver@2c0d (554aed13)] Proxying [POST /element/8A000000-0000-0000-D403-000000000000/click] to [POST http://127.0.0.1:8100/session/5CAACF44-C55A-4EB4-90F9-030BD95A701B/element/8A000000-0000-0000-D403-000000000000/click] with body: {} [XCUITestDriver@2c0d (554aed13)] Got response with status 200: {"value":null,"sessionId":"5CAACF44-C55A-4EB4-90F9-030BD95A701B"} [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.click() result: null [HTTP] <-- POST /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/element/8A000000-0000-0000-D403-000000000000/click 200 2883 ms - 14 [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/screenshot [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getScreenshot() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getScreenshot' [XCUITestDriver@2c0d (554aed13)] Executing command 'getScreenshot' [XCUITestDriver@2c0d (554aed13)] Taking screenshot with WDA [XCUITestDriver@2c0d (554aed13)] Matched '/screenshot' to command name 'getScreenshot' [XCUITestDriver@2c0d (554aed13)] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/5CAACF44-C55A-4EB4-90F9-030BD95A701B/screenshot] with no body [XCUITestDriver@2c0d (554aed13)] Got response with status 200: {"value":"iVBORw0KGgoAAAANSUhEUgAABJIAAAnkCAIAAADZI9xUAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAABJKgAwAEAAAAAQAACeQAAAAAOMw3jQAAAAlwSFlzAAALEwAACxMBAJqcGAAAABxpRE9UAAAAAgAAAAAAAATyAAAAKAAABPIAAATyAAfpopAEY+YAAEAASURBVHgB7J0JnBTF2f8XlnO55BJB1Ch77wJq1HjEIybR983lP3ljhGUX8MArUZO8HnmTmJjExFxv4msiN94XKqKoqCAoyA0qp9wgct/sPXf9f1XPTG3v7OzsMTPL7syvP01T011d9dS3qnufX1d1dZriQgIkQAIkQAIkQAIkQAIkQAIk0CoJBAIBv9+f1ipto1EkQAIkQAIkQAIkQAIkQAIkQAKKso2NgARIgARIgARIgARIgARIgARaNQHKtlZdPTSOBEiABEiABEiABEiABEiABCjb2AZIgARIgARIgARIgARIgARIoFUToGxr1dVD40iABEiABEiABEiABEiABEiAso1tgARIgARIgARIgARIgARIgARaNQHKtlZdPTSOBEiABEiABEiABEiABEiABCjb2AZIgARIgARIgARIgARIgARIoLUTgHLjd9taeyXRPhIgARIgARIgARIgARIggVQmQNmWyrXPspMACZAACZAACZAACZAACbQNAuxtaxv1RCtJgARIgARIgARIgARIgARSlgBlW8pWPQtOAiRAAiRAAiRAAiRAAiTQNghQtrWNeqKVJEACJEACJEACJEACJEACKUuAsi1lq54FJwESIAESIAESIAESIAESaBsEKNvaRj3RShIgARIgARIgARIgARIggZQlQNm... [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABJIAAAnkCAIAAADZI9xUAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAABJKgAwAEAAAAAQAACeQAAAAAOMw3jQAAAAlwSFlzAAALEwAACxMBAJqcGAAAABxpRE9UAAAAAgAAAAAAAATyAAAAKAAABPIAAATyAAfpopAEY+YAAEAASURBVHgB7J0JnBTF2f8XlnO55BJB1Ch77wJq1HjEIybR983lP3ljhGUX8MArUZO8HnmTmJjExFxv4msiN94XKqKoqCAoyA0qp9wgct/sPXf9f1XPTG3v7OzsMTPL7syvP01T011d9dS3qnufX1d1dZriQgIkQAIkQAIkQAIkQAIkQAIk0CoJBAIBv9+f1ipto1EkQAIkQAIkQAIkQAIkQAIkQAKKso2NgARIgARIgARIgARIgARIgARaNQHKtlZdPTSOBEiABEiABEiABEiABEiABCjb2AZIgARIgARIgARIgARIgARIoFUToGxr1dVD40iABEiABEiABEiABEiABEiAso1tgARIgARIgARIgARIgARIgARaNQHKtlZdPTSOBEiABEiABEiABEiABEiABCjb2AZIgARIgARIgARIgARIgARIoLUTgHLjd9taeyXRPhIgARIgARIgARIgARIggVQmQNmWyrXPspMACZAACZAACZAACZAACbQNAuxtaxv1RCtJgARIgARIgARIgARIgARSlgBlW8pWPQtOAiRAAiRAAiRAAiRAAiTQNghQtrWNeqKVJEACJEACJEACJEACJEACKUuAsi1lq54FJwESIAESIAESIAESIAESaBsEKNvaRj3RShIgARIgARIgARIgARIggZQlQNmWslXPgpMA... [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/screenshot 200 251 ms - 1077220 [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/window/rect [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getWindowRect() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getWindowRect' [XCUITestDriver@2c0d (554aed13)] Executing command 'getWindowRect' [XCUITestDriver@2c0d (554aed13)] Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/5CAACF44-C55A-4EB4-90F9-030BD95A701B/window/size] with no body [XCUITestDriver@2c0d (554aed13)] Got response with status 200: {"value":{"width":390,"height":844},"sessionId":"5CAACF44-C55A-4EB4-90F9-030BD95A701B"} [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getWindowRect() result: {"width":390,"height":844,"x":0,"y":0} [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/window/rect 304 52 ms - - [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/source [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getPageSource() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getPageSource' [XCUITestDriver@2c0d (554aed13)] Executing command 'getPageSource' [XCUITestDriver@2c0d (554aed13)] Matched '/source?format=xml&scope=AppiumAUT' to command name 'getPageSource' [XCUITestDriver@2c0d (554aed13)] Proxying [GET /source?format=xml&scope=AppiumAUT] to [GET http://127.0.0.1:8100/session/5CAACF44-C55A-4EB4-90F9-030BD95A701B/source?format=xml&scope=AppiumAUT] with no body [XCUITestDriver@2c0d (554aed13)] Got response with status 200: {"value":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n <XCUIElementTypeApplication type=\"XCUIElementTypeApplication\" name=\"Talabat\" label=\"Talabat\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUI... [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getPageSource() result: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n <XCUIElementTypeApplication type=\"XCUIElementTypeApplication\" name=\"Talabat\" label=\"Talabat\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" accessible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" index=\"0\">\n <XCUIElementTypeOther type=\"XCUIElementTy... [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/source 304 942 ms - - [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getTimeouts() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getTimeouts' [XCUITestDriver@2c0d (554aed13)] Executing command 'getTimeouts' [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts 304 7 ms - - [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getTimeouts() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getTimeouts' [XCUITestDriver@2c0d (554aed13)] Executing command 'getTimeouts' [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts 304 5 ms - - [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getTimeouts() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getTimeouts' [XCUITestDriver@2c0d (554aed13)] Executing command 'getTimeouts' [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts 304 7 ms - - [HTTP] [HTTP] --> GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts [HTTP] {} [FlutterDriver@3c32 (506bc80a)] Calling AppiumDriver.getTimeouts() with args: ["506bc80a-ba2a-4bc7-a9c7-e981c3abc465"] [FlutterDriver] Executing proxied driver command 'getTimeouts' [XCUITestDriver@2c0d (554aed13)] Executing command 'getTimeouts' [FlutterDriver@3c32 (506bc80a)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [HTTP] <-- GET /session/506bc80a-ba2a-4bc7-a9c7-e981c3abc465/timeouts 304 4 ms - -

KazuCocoa commented 3 months ago

In native app ccontext, click kicks https://developer.apple.com/documentation/xctest/xcuielement/1618666-tap so it could indicate the element did not handle the tap event via XCTest framework by some reason. Maybe the iOS internal reason, or implementation specific reason.

As Appium, you could try out W3C actions API, or mobile commands such as https://appium.github.io/appium-xcuitest-driver/latest/reference/execute-methods/#mobile-tap and does coordinate based actions.