Record http form posts via a browser

2019-01-21 09:28发布

I'm trying to automate the login to a website and submission of a form.

Is there a browser plugin (for firefox or Chrome) that allows you to record HTTP GET and POST requests in a form that allows them to be played back at a later point? I'm looking for something that will be possible to automate from a script e.g. via curl or wget.

I've tried using the Chrome developer tools to capture POST form data but I get errors when trying to replicate the request with wget which suggests I'm missing some cookies or other parameters. Ideally there would a nice automated way of doing this rather than doing lots of trial and error.

9条回答
叛逆
2楼-- · 2019-01-21 09:41

In Firefox, turn on the Persist option in Firebug to be sure to capture the POST. Then install and use the "Bookmark POST" add-on to bookmark the POST request for later use.

查看更多
小情绪 Triste *
3楼-- · 2019-01-21 09:41

The Safari developer tools and Firebug are sufficient for your needs.

查看更多
孤傲高冷的网名
5楼-- · 2019-01-21 09:43

Have you tried Selenium?

查看更多
太酷不给撩
6楼-- · 2019-01-21 09:47

Not exactly a browser plugin, but Fiddler can capture all the HTTP data passing back and forth; with FiddlerScript or FiddlerCore, it is then simple to export that into a text file - and pass that into cURL as request headers and request body.

查看更多
Viruses.
7楼-- · 2019-01-21 09:49

Recently I cam across this beautiful chrome extension which does what you ask: Katalon Recorder

Katalon Recorder will make your test automation work a lot easier.

  • Record, play, debug with speed control, pause/resume, breakpoints capabilities.

  • Enjoy fastest execution speed compared to other extensions with Selenium 3 core engine.

  • Make use of multiple locator types including XPath & CSS.

  • Use original Selenium IDE commands (Selenese), plus block statement if...elseIf...else...endIf and while...endWhile. Testing file input control is supported.

  • Import test data from CSV files for data-driven testing.

  • Report easily with logs, screenshots capturing, with historical data and analytics from Katalon Analytics.

  • Compose & organize test cases in suites. Never get your work lost with autosave feature.

  • Import original Selenium IDE (Firefox extension) tests.

  • Export to Selenium WebDriver scripts in these frameworks: C# (MSTest and NUnit), Java (TestNG and JUnit), Ruby (RSpec), Python (unittest), Groovy (Katalon Studio), Robot Framework, and XML.

查看更多
登录 后发表回答