Webdriver: Forward ErrorStatus for take element screenshot (#38134)

Based on
[spec](tests/wpt/meta/webdriver/tests/classic/take_element_screenshot/screenshot.py.ini),
we should not expect the error to only be
`ErrorStatus::StaleElementReference`.

Testing:
`tests/wpt/meta/webdriver/tests/classic/take_element_screenshot/screenshot.py.ini`

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
Kenzie Raditya Tirtarahardja 2025-07-18 14:42:51 +08:00 committed by GitHub
parent 39144bb013
commit b4b9e2c515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 22 deletions

View file

@ -2324,10 +2324,7 @@ impl Handler {
serde_json::to_value(encoded)?,
)))
},
Err(_) => Err(WebDriverError::new(
ErrorStatus::StaleElementReference,
"Element not found",
)),
Err(error) => Err(WebDriverError::new(error, "Element not found")),
}
}