This commit is contained in:
Josh at WLTechBlog 2025-08-18 15:05:11 -05:00
parent ba5d7f428f
commit dd55c67ad4
1 changed files with 10 additions and 1 deletions

View File

@ -3503,7 +3503,16 @@ func (d *Daemon) interactMultiple(tabID, interactionsJSON string, timeout int) (
if jsErr == nil {
// Trigger change event
_, _ = element.Eval("this.dispatchEvent(new Event('change', { bubbles: true }))")
interactionResult.Success = true
// Verify the JavaScript selection worked by checking the element's value
currentValue, err := element.Property("value")
if err != nil {
interactionResult.Error = fmt.Sprintf("failed to verify selection: %v", err)
} else if currentValue.Str() == interaction.Value {
interactionResult.Success = true
} else {
interactionResult.Error = fmt.Sprintf("failed to select option: %s (current value: %s)", interaction.Value, currentValue.Str())
}
} else {
interactionResult.Error = fmt.Sprintf("failed to select option: %v", err)
}