multiple
This commit is contained in:
parent
ba5d7f428f
commit
dd55c67ad4
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue