Reply To: Trouble storing/printing value of selector element to results file

PennController for IBEX Forums Support Trouble storing/printing value of selector element to results file Reply To: Trouble storing/printing value of selector element to results file

#4337
Jeremy
Keymaster

Hi Cory,

It’s a known bug of sorts: you are storing the image element itself in the variable, rather than the name of the element, which is presumably what you want to get in your log command. I’ll see if I can fix it in the next release of PennController, because I think what you’re doing makes total sense.

In the meantime, here is what you can do:

newVar("Response")
    .settings.global()
,
newSelector("SelectedResponse")
    .settings.add(getImage("HappyFace"), getImage("SadFace"))
    .settings.log()
    .settings.once()
    .wait()
    .test.selected(getImage("HappyFace"))
    .success( getVar("Response").set("HappyFace") )
    .failure( getVar("Response").set("SadFace") )

I’m making the Var element global because you are accessing it from outside PennController(), even though it seemed to be working even without the .settings.global() line…

Jeremy