locked
How do we get value of NEW CheckBox via UITest? RRS feed

  • Question

  • User239705 posted

    All,

    I'm using the new Xamarin.Forms CheckBox widget and I'm trying to get the IsChecked valued when running a UITest. Looking at the app.repl tree I see the widget has a class of "XamarinFormsPlatformiOSFormsCheckBox" as I'm running the iOS version AND that has a base class of "UIButton".

    With all that said, is there a way to get the value of the IsChecked property? I've tried some of the permutations below to no avail: app.Query(c => c.Id("NameOfCheckBox").Invoke("IsChecked").Value()).First() app.Query(c => c.Id("NameOfCheckBox").Invoke("isChecked").Value()).First() app.Query(c => c.Id("NameOfCheckBox").Invoke("on").Value()).First()

    Note: They all return TRUE no matter what the checked state is. Any help would be appreciated.

    Monday, June 22, 2020 7:59 PM

All replies

  • User239705 posted

    @ShaneNeuville would by chance happen to know how to achieve this?

    Wednesday, June 24, 2020 5:56 PM
  • User323122 posted

    Hi, I'm curious if there is an answer to this? I just updated to xamarin.uitest 3.0.11 and I'm having the same problem.

    I was using this for a UISwitch and assumed it would work for a check box... app.Query(x => x.Marked(ID).Invoke("isOn").Value())[index]

    But I've tried a few variations and so far no luck...

    Thursday, December 3, 2020 2:08 PM
  • User74 posted

    @SeanConlon Use app.Repl() to se what properties it has etc.

    Thursday, December 3, 2020 3:26 PM