How can you find relative WebView elements in calabash-ios and calabash-android. I know that the syntax is slightly different between the two, but the problem is the same. Here is an example:
1) This query is too broad:
query("webView css:'div'")
2) I can find the div I need with:
query("webView css:'div'").find { |x| x["textContent"] =~ /text from my div/ }
3) and I can find all the button elements
query("webView css:'.button')
# Returns all the visible elements with .button class
4) and I can find all the buttons that are in a div
query("webView css:'div > .button'")
# Returns all the visible button elements that are children of a div
What I cannot do is find the button, which is the child of the div found in the example 2.
What I've tried:
pseudo-selectors don't work.
query("webView css:'div:first'")
a combination of inheritance and class didn't work.
query("webView css:'div.classy-class > .button'")
I'm going crazy. How can I find this?
source
share