I would assume that you want to test, what happens when the boolean value is changed? And that you have some validation code, which has UI you need to handle?
“Activate()” just moves the “cursor” to the field/control. But you can use this first and then use .Value(TRUE) to imitate the user changing the value to true.
A handler function is only used if you are Invoking an action, of running other code which has some kind of UI that you need to handle. If it has a CONFIRM, then you need a confirm handler. If it has a message, then you need a message handler etc.
So I would assume that you want to test what happens when the boolean value is changed? And that you have some validation code, which has UI you need to handle?
Although its fine to use TestPages, then you should generally try to split your UI tests, from non-UI tests. You could just as well test the above function without a TestPage, just by using the Item record.
On the page “item card” I created a bool field. And now I would like to test, if it is true or false.
If it is true, means if the user activates the field, other fields will be shown to the user. That situation I want to test. That is why I thought I could use the Activate-function.
If it is true, then nothing happens. Activate is just like activating a specific page - here you just activate the field. It’s just as if you moved to the field with the Tab. You are not pressing or entering anything here.
You need to test the Invocation of the field, if it is a field with validation code. That would be ItemCard.IsChecked.Invoke();
And then if your code contains any UI then you would need a handler, to handle that UI.
Just create the function|variable on the page (it is based on that version you use) and for each field from list which you want to hide|show set the property Visible = this variable.
When user updates check-mark use CurrPage.Update(false);