skip hidden and disabled controls
This commit is contained in:
@@ -201,6 +201,11 @@ def fill_invoice_fields(page: Page) -> None:
|
|||||||
for selector in selectors:
|
for selector in selectors:
|
||||||
el = page.locator(selector).first
|
el = page.locator(selector).first
|
||||||
if el.count() > 0:
|
if el.count() > 0:
|
||||||
|
input_type = (el.get_attribute("type") or "").lower()
|
||||||
|
if input_type == "hidden":
|
||||||
|
continue
|
||||||
|
if not el.is_visible() or not el.is_enabled():
|
||||||
|
continue
|
||||||
tag = el.evaluate("el => el.tagName.toLowerCase()")
|
tag = el.evaluate("el => el.tagName.toLowerCase()")
|
||||||
if tag == "select":
|
if tag == "select":
|
||||||
el.select_option(label=value)
|
el.select_option(label=value)
|
||||||
|
|||||||
Reference in New Issue
Block a user