3

我需要知道在硒测试中执行 JSON 的最简单方法。一个例子是我想 POST { "UserId":"234234" } 并测试返回的内容。目前使用 Advanced REST client chrome app 手动测试。我已经对这个主题进行了很多搜索,但没有遇到任何好的例子。

4

1 回答 1

3

This doesn't sound like it's best solved by selenium. With Selenium you would interact with the form to get that value to post, and handle the subsequent AJAX response / page refresh. If you wish to POST data you should look at a library that performs those types of operations across the wire.

If you are looking for a HTTP library, then Apache has a good one (Java based).

于 2012-05-09T15:33:08.380 回答