Hi,

I don't know about tools too much. There are some http testing tools. But one easy way is to use curl or similar tools to generate requests and get the answer.

E.g. if you have a ajax request '/myrequest.json' you can call it using "curl http://myserver:8000/myrequest.json"; and you get the answer on the command line. There are many options in curl to set up the request. Run "curl --help|less" to get a list of them.

Another very flexible way to generate requests is to use echo and nc (netcat). If you are very familiar with http you can run the above request in bash like that: echo -en 'GET /myrequest.json HTTP/1.1\r\nConnection:close\r\nHost:localhost\r\n\r\n' |
       nc myserver 8000

The option -e in echo translate common escape sequences like \r and \n. -n suppresses the new line at the end.

Another option is to use cxxtools. I have created unittests for the rpc stuff there. I set up a rpc server and run a client. Look into the unittests of cxxtools for examples. In cxxtools it is quite easy since the server and client can run in the same event loop. It is a little more difficult in tntnet. Since it has its own event loop.

Tommi

Am 20.02.2016 um 22:42 schrieb Raphael Fuchs:
Hi mailinglist,


my application responds to a lot of ajax requests and I would like to create tests cases for them.

Do you know of a good tool to send xmlhttp requests and check their responses in a unit-test like fashion?

Best regards
Raphael



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
Hihttp://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140


_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to