bump
This commit is contained in:
parent
a69560849c
commit
af2a0584de
|
@ -1975,16 +1975,15 @@ func (d *Daemon) selectElement(tabID, selector, value string, selectionTimeout,
|
|||
changeScript := fmt.Sprintf("document.querySelector(\"%s\").dispatchEvent(new Event(\"change\", { bubbles: true }))", selector)
|
||||
page.Eval(changeScript)
|
||||
|
||||
// Verify the selection worked by checking the actual element value
|
||||
verifyScript := fmt.Sprintf("document.querySelector(\"%s\").value", selector)
|
||||
result, err := page.Eval(verifyScript)
|
||||
// Verify the selection worked by checking the element's value property directly
|
||||
currentValue, err := element.Property("value")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to verify selection: %w", err)
|
||||
}
|
||||
|
||||
// Check if the selection actually worked
|
||||
if result.Value.Nil() || result.Value.String() != value {
|
||||
return fmt.Errorf("failed to select option '%s' in element", value)
|
||||
if currentValue.Str() != value {
|
||||
return fmt.Errorf("failed to select option '%s' in element (current value: %s)", value, currentValue.Str())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue