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)
|
changeScript := fmt.Sprintf("document.querySelector(\"%s\").dispatchEvent(new Event(\"change\", { bubbles: true }))", selector)
|
||||||
page.Eval(changeScript)
|
page.Eval(changeScript)
|
||||||
|
|
||||||
// Verify the selection worked by checking the actual element value
|
// Verify the selection worked by checking the element's value property directly
|
||||||
verifyScript := fmt.Sprintf("document.querySelector(\"%s\").value", selector)
|
currentValue, err := element.Property("value")
|
||||||
result, err := page.Eval(verifyScript)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to verify selection: %w", err)
|
return fmt.Errorf("failed to verify selection: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the selection actually worked
|
// Check if the selection actually worked
|
||||||
if result.Value.Nil() || result.Value.String() != value {
|
if currentValue.Str() != value {
|
||||||
return fmt.Errorf("failed to select option '%s' in element", value)
|
return fmt.Errorf("failed to select option '%s' in element (current value: %s)", value, currentValue.Str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue