I'm trying to get the value of every class using query command. Below is the sample UI component that I get:
[0] {
"class" => "UITabBarSwappableImageView",
"id" => "imageView-34",
"rect" => {
"center_x" => 288,
"y" => 522,
"width" => 48,
"x" => 264,
"center_y" => 538,
"height" => 32
},
"frame" => {
"y" => 2,
"width" => 48,
"x" => 6,
"height" => 32
},
"label" => nil,
"description" => "<UITabBarSwappableImageVie....>"
On Android, I can just use this to list all the values of class components:
query("*", :class)
However, I can't seem to use the same command on iOS. I get this as the result:
irb(main):135:0> query "*", :class
[
[ 0] nil,
[ 1] nil,
[ 2] nil,
[ 3] nil
]
I know that with the labels, I can use :accessibilityLabel to do the job, but not when I try to get value from class/id/etc.
Could someone please shed some light?