Checking if scale item with canvas label is selected

PennController for IBEX Forums Support Checking if scale item with canvas label is selected

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10664
    guy
    Participant

    Hello,

    I am trying to put together a test where subjects must select the option from a scale. There is a “right answer” that subjects must select. Each scale’s label is a canvas comprising text and a button. How do I test whether the right option is selected? This isn’t working:

    newScale('pltest', "0", "1", "2")
            .vertical()
            .radio()
            .label(0, getCanvas('pl_0_can'))
            .label(1, getCanvas('pl_1_can'))
            .label(2, getCanvas('pl_2_can'))
            .labelsPosition("right")
            .settings.center()
            .print()
            .wait(getScale('pltest').test.selected(getCanvas('pl_0_can'))

    Thank you!

    #10675
    Jeremy
    Keymaster

    Hello,

    When you set an option’s label using a reference to a PennController element, you can test the selected value by using that element’s name. As a consequence, you’ll want to make sure that when multiple labels refer to PennController elements, the elements have different names (which they do, in your case). So you can do this:

    newScale('pltest', "0", "1", "2")
        .vertical()
        .radio()
        .label(0, getCanvas('pl_0_can'))
        .label(1, getCanvas('pl_1_can'))
        .label(2, getCanvas('pl_2_can'))
        .labelsPosition("right")
        .settings.center()
        .print()
        .wait(getScale('pltest').test.selected("pl_0_can"))

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.