diff --git a/seleniumbase/js_code/recorder_js.py b/seleniumbase/js_code/recorder_js.py index bd2b8598..66d85f22 100755 --- a/seleniumbase/js_code/recorder_js.py +++ b/seleniumbase/js_code/recorder_js.py @@ -37,7 +37,9 @@ var cssPathByAttribute = function(el, attr) { while (el !== null && el.nodeType === Node.ELEMENT_NODE) { var selector = el.nodeName.toLowerCase(); if (el.hasAttribute(attr) && - el.getAttribute(attr).length > 0) { + el.getAttribute(attr).length > 0 && + !el.getAttribute(attr).includes('\n')) + { the_attr = el.getAttribute(attr); if (the_attr.includes('"')) the_attr = the_attr.replace('"', '\\"');