Skip to content

Commit 823ded7

Browse files
committed
Fix handling of newlines in html attributes
Fix #77
1 parent a57d1ac commit 823ded7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

notebooks/GUIFuzzer.ipynb

+8-8
Original file line numberDiff line numberDiff line change
@@ -1072,16 +1072,16 @@
10721072
" input_name = elem.text\n",
10731073
"\n",
10741074
" if input_type in [\"checkbox\", \"radio\"]:\n",
1075-
" actions.add(\"check('%s', <boolean>)\" % html.escape(input_name))\n",
1075+
" actions.add(\"check('''%s''', <boolean>)\" % html.escape(input_name))\n",
10761076
" elif input_type in [\"text\", \"number\", \"email\", \"password\"]:\n",
1077-
" actions.add(\"fill('%s', '<%s>')\" % (html.escape(input_name), html.escape(input_type)))\n",
1077+
" actions.add(\"fill('''%s''', '<%s>')\" % (html.escape(input_name), html.escape(input_type)))\n",
10781078
" elif input_type in [\"button\", \"submit\"]:\n",
1079-
" actions.add(\"submit('%s')\" % html.escape(input_name))\n",
1079+
" actions.add(\"submit('''%s''')\" % html.escape(input_name))\n",
10801080
" elif input_type in [\"hidden\"]:\n",
10811081
" pass\n",
10821082
" else:\n",
10831083
" # TODO: Handle more types here\n",
1084-
" actions.add(\"fill('%s', <%s>)\" % (html.escape(input_name), html.escape(input_type)))\n",
1084+
" actions.add(\"fill('''%s''', <%s>)\" % (html.escape(input_name), html.escape(input_type)))\n",
10851085
" except StaleElementReferenceException:\n",
10861086
" pass\n",
10871087
"\n",
@@ -1131,9 +1131,9 @@
11311131
" if button_name is None:\n",
11321132
" button_name = elem.text\n",
11331133
" if button_type == \"submit\":\n",
1134-
" actions.add(\"submit('%s')\" % html.escape(button_name))\n",
1134+
" actions.add(\"submit('''%s''')\" % html.escape(button_name))\n",
11351135
" elif button_type != \"reset\":\n",
1136-
" actions.add(\"click('%s')\" % html.escape(button_name))\n",
1136+
" actions.add(\"click('''%s''')\" % html.escape(button_name))\n",
11371137
" except StaleElementReferenceException:\n",
11381138
" pass\n",
11391139
"\n",
@@ -1181,9 +1181,9 @@
11811181
" a_href = elem.get_attribute(\"href\")\n",
11821182
" if a_href is not None:\n",
11831183
" if self.follow_link(a_href):\n",
1184-
" actions.add(\"click('%s')\" % html.escape(elem.text))\n",
1184+
" actions.add(\"click('''%s''')\" % html.escape(elem.text))\n",
11851185
" else:\n",
1186-
" actions.add(\"ignore('%s')\" % html.escape(elem.text))\n",
1186+
" actions.add(\"ignore('''%s''')\" % html.escape(elem.text))\n",
11871187
" except StaleElementReferenceException:\n",
11881188
" pass\n",
11891189
"\n",

0 commit comments

Comments
 (0)