diff --git a/agent/runner.py b/agent/runner.py index d01f03f..d9b2b9e 100644 --- a/agent/runner.py +++ b/agent/runner.py @@ -63,7 +63,7 @@ SNAPSHOT_JS = """ else if (wrap && tag !== 'label') label = wrap.innerText + ' ' + label; const item = {n, tag, type, label: label.replace(/\\s+/g, ' ').trim().slice(0, maxLabel)}; if (tag === 'select') item.options = Array.from(el.options).map(o => o.text.trim()).slice(0, maxOptions); - if (type === 'checkbox' || type === 'radio') item.checked = el.checked; + if (tag === 'input' && (type === 'checkbox' || type === 'radio')) item.checked = el.checked; elements.push(item); } const captcha = !!document.querySelector( diff --git a/agent/tests/sites.py b/agent/tests/sites.py index 54ee361..21ace3f 100644 --- a/agent/tests/sites.py +++ b/agent/tests/sites.py @@ -37,6 +37,8 @@ PAGES = { "
", "/frame-password": "

Abmelden

", "/pwframe": "
", + # a button that carries type=radio has no "checked" property of its own + "/odd-type": "

Bitte bestätigen

", # overrides Array.prototype.push, which the snapshot script uses, to plant a prompt marker in an element number "/tamper-push": "

Bitte bestätigen