Skip to content

Commit

Permalink
Fix handling of newlines in html attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
SecureAB committed Jun 21, 2020
1 parent a57d1ac commit 823ded7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions notebooks/GUIFuzzer.ipynb
Expand Up @@ -1072,16 +1072,16 @@
" input_name = elem.text\n",
"\n",
" if input_type in [\"checkbox\", \"radio\"]:\n",
" actions.add(\"check('%s', <boolean>)\" % html.escape(input_name))\n",
" actions.add(\"check('''%s''', <boolean>)\" % html.escape(input_name))\n",
" elif input_type in [\"text\", \"number\", \"email\", \"password\"]:\n",
" actions.add(\"fill('%s', '<%s>')\" % (html.escape(input_name), html.escape(input_type)))\n",
" actions.add(\"fill('''%s''', '<%s>')\" % (html.escape(input_name), html.escape(input_type)))\n",
" elif input_type in [\"button\", \"submit\"]:\n",
" actions.add(\"submit('%s')\" % html.escape(input_name))\n",
" actions.add(\"submit('''%s''')\" % html.escape(input_name))\n",
" elif input_type in [\"hidden\"]:\n",
" pass\n",
" else:\n",
" # TODO: Handle more types here\n",
" actions.add(\"fill('%s', <%s>)\" % (html.escape(input_name), html.escape(input_type)))\n",
" actions.add(\"fill('''%s''', <%s>)\" % (html.escape(input_name), html.escape(input_type)))\n",
" except StaleElementReferenceException:\n",
" pass\n",
"\n",
Expand Down Expand Up @@ -1131,9 +1131,9 @@
" if button_name is None:\n",
" button_name = elem.text\n",
" if button_type == \"submit\":\n",
" actions.add(\"submit('%s')\" % html.escape(button_name))\n",
" actions.add(\"submit('''%s''')\" % html.escape(button_name))\n",
" elif button_type != \"reset\":\n",
" actions.add(\"click('%s')\" % html.escape(button_name))\n",
" actions.add(\"click('''%s''')\" % html.escape(button_name))\n",
" except StaleElementReferenceException:\n",
" pass\n",
"\n",
Expand Down Expand Up @@ -1181,9 +1181,9 @@
" a_href = elem.get_attribute(\"href\")\n",
" if a_href is not None:\n",
" if self.follow_link(a_href):\n",
" actions.add(\"click('%s')\" % html.escape(elem.text))\n",
" actions.add(\"click('''%s''')\" % html.escape(elem.text))\n",
" else:\n",
" actions.add(\"ignore('%s')\" % html.escape(elem.text))\n",
" actions.add(\"ignore('''%s''')\" % html.escape(elem.text))\n",
" except StaleElementReferenceException:\n",
" pass\n",
"\n",
Expand Down

0 comments on commit 823ded7

Please sign in to comment.