Skip to content

Conversation

@KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa changed the title [wip]Add image strategy Add image strategy Aug 4, 2018
@KazuCocoa KazuCocoa merged commit 590e798 into appium:master Aug 4, 2018
@KazuCocoa KazuCocoa deleted the add-image-strategy branch August 4, 2018 13:09
@KazuCocoa
Copy link
Member Author

📝
Not client side issue though

# Buttons with find element id
e2 = @@driver.find_element :accessibility_id, 'Buttons'
# => #<Selenium::WebDriver::Element:0x..f9ac923d253de3a9c id="25000000-0000-0000-504F-010000000000">
e2.rect
# => #<struct Selenium::WebDriver::Rectangle x=17, y=80, width=75, height=27>
e2.click #=> Buttons was clicked

# Buttons image
e = @@driver.find_element_by_image 'path to below button image'
e.rect
# [BaseDriver] Image template matched: {"x":24,"y":162,"width":170,"height":53}
e2.click #=> (x: 109, y: 188.5) is clicked. The point was _TextFields_ in here.
              #=> When I tried to tap (x: 109, y: 135.5), the point was _Controls_.
              #=> The W3C touch action probably include statusbar additionally?
  • the button image

[BaseDriver] Not verifying screenshot dimensions match screen
[BaseDriver] Image template matched: {"x":24,"y":162,"width":170,"height":53}
[BaseDriver] Will tap on image element at coordinate [109, 188.5]
[BaseDriver] Will tap using W3C actions
[debug] [XCUITest] Received the following W3C actions: [
[debug] [XCUITest]   {
[debug] [XCUITest]     "type": "pointer",
[debug] [XCUITest]     "id": "mouse",
[debug] [XCUITest]     "parameters": {
[debug] [XCUITest]       "pointerType": "touch"
[debug] [XCUITest]     },
[debug] [XCUITest]     "actions": [
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerMove",
[debug] [XCUITest]         "x": 109,
[debug] [XCUITest]         "y": 188.5,
[debug] [XCUITest]         "duration": 0
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerDown"
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pause",
[debug] [XCUITest]         "duration": 125
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerUp"
[debug] [XCUITest]       }
[debug] [XCUITest]     ]
[debug] [XCUITest]   }
[debug] [XCUITest] ]
[debug] [XCUITest] Preprocessed actions: [
[debug] [XCUITest]   {
[debug] [XCUITest]     "type": "pointer",
[debug] [XCUITest]     "id": "mouse",
[debug] [XCUITest]     "parameters": {
[debug] [XCUITest]       "pointerType": "touch"
[debug] [XCUITest]     },
[debug] [XCUITest]     "actions": [
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerMove",
[debug] [XCUITest]         "x": 109,
[debug] [XCUITest]         "y": 188.5,
[debug] [XCUITest]         "duration": 0
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerDown"
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pause",
[debug] [XCUITest]         "duration": 125
[debug] [XCUITest]       },
[debug] [XCUITest]       {
[debug] [XCUITest]         "type": "pointerUp"
[debug] [XCUITest]       }
[debug] [XCUITest]     ]
[debug] [XCUITest]   }
[debug] [XCUITest] ]
[debug] [JSONWP Proxy] Matched '/actions' to command name 'performActions'
[debug] [JSONWP Proxy] Proxying [POST /actions] to [POST http://localhost:8100/session/E999F768-983A-40AB-BC61-F827E559DEC1/actions] with body: {"actions":[{"type":"pointer","id":"mouse","parameters":{"pointerType":"touch"},"actions":[{"type":"pointerMove","x":109,"y":188.5,"duration":0},{"type":"pointerDown"},{"type":"pause","duration":125},{"type":"pointerUp"}]}]}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"E999F768-983A-40AB-BC61-F827E559DEC1","status":0}
[debug] [W3C] Responding to client with driver.click() result: {}

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

Successfully merging this pull request may close these issues.

1 participant