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 20, 2020
1 parent a57d1ac commit c2fd76f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions notebooks/GUIFuzzer.ipynb
Original file line number Diff line number Diff line change
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

0 comments on commit c2fd76f

Please sign in to comment.