Skip to content

find elements except for name attributes in text/s, button/s #462

@KazuCocoa

Description

@KazuCocoa

Previous find_exact/s/text/s/button/s search words which match with name, value and label attributes like the following attributes. This method is based on UIAutomation script directly.

    def string_visible_contains(element, value)
      contains = {
        target:      value,
        substring:   true,
        insensitive: true
      }

      {
        typeArray:   [element],
        onlyVisible: true,
        name:        contains,
        label:       contains,
        value:       contains
      }
    end

In XCUITest, this library used :xpath strategy before 9.1.3 to find elements. But the results differ from UIAutomation. (e.g. button's tests)

In 9.1.3+, button/s and test/s use find_elements :name, "something" to avoid using xpath to improve the performance. But this results not same as previous one yet. e.g. button's test
I think, we should use elements not only name but also label and value.( in WDA, they are


  • How to improve
  1. get elements with find_elements :name, "something" and check their label and value , visibility attributes in ruby script.
    • WDA can search identifier with :name, :id, accessibility id or -ios predicate string . xcuitest-driver, WDA
    • So, we can check other attributes after getting elements.
  2. use : predicate instead of UIAutomation script directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions