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
- 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.
- use
: predicate instead of UIAutomation script directly.
Previous
find_exact/s/text/s/button/ssearch words which match withname,valueandlabelattributes like the following attributes. This method is based on UIAutomation script directly.In XCUITest, this library used
:xpathstrategy before 9.1.3 to find elements. But the results differ from UIAutomation. (e.g. button's tests)In
9.1.3+,button/sandtest/susefind_elements :name, "something"to avoid using xpath to improve the performance. But this results not same as previous one yet. e.g. button's testI think, we should use elements not only
namebut alsolabelandvalue.( in WDA, they arefind_elements :name, "something"and check theirlabelandvalue,visibilityattributes in ruby script.:name,:id,accessibility idor-ios predicate string. xcuitest-driver, WDA: predicateinstead of UIAutomation script directly.