0

I'm trying to get the value of a property using Calabash, specifically the "value" property on my "CustomSwitch" class. Here's the result anytime I try it:

irb(main):029:0> query "CustomSwitch", :value
[
    [0] "*****"
]

I get a similar output for just about every other view I try. Here's some more info about my setup:

xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

xcodebuild -version
Xcode 7.1
Build version 7B91b

calabash-ios version
0.16.4

If anyone knows why this syntax is acting funky for me I'd greatly appreciate some help!

Bill L
  • 2,576
  • 4
  • 28
  • 55

2 Answers2

1
> query "CustomSwitch", :value
"******"

This means that view matched by the query does not respond to the selector value. If this is an on-off switch that is a subclass of UISwitch, the correct selector is isOn.

jmoody
  • 2,480
  • 1
  • 16
  • 22
0

The following code is displaying array of values

> query "CustomSwitch", :value

So, try this one

> query("CustomSwitch",:value)[0]

or

> query("CustomSwitch",:value).first
Aravin
  • 6,605
  • 5
  • 42
  • 58