As I develop a Protractor script to test my quiz game, which involves displaying random questions and answers, I am faced with the challenge of identifying the correct answer. This information is not directly available as an element on the page, so I need a way to access it through the model.
The model stores the answers in Choice in Question.Choices
, and I specifically need to locate the Choice where Choice.IsCorrect
is true. How can I retrieve this value without relying on elements?
Would using the element()
function be appropriate for this task?
element(by.repeater('Choice in Question.Choices').row(0).column('Choice.IsCorrect'))