我在为学校做作业:
所需经费:
"Fantabulous"
这就是我所拥有的:
//@Test
public void search_for_movies_on_string_and_validate_one_of_the_results() {
Response response = given().
param("apikey", apiKey).
param("s", "Fantabulous").
when().get(baseURI).
then().extract().response();
JsonPath jsonPath = response.jsonPath();
List<String> idList = jsonPath.getList("Search.imdbID");
Assert.assertTrue(idList.contains("tt7713068"));
}如何循环列表以搜索具有正确ID的电影?
apiKey = "7548cb76“
baseURI = "http://www.omdbapi.com/“
发布于 2020-04-03 19:29:09
"Fantabulous").when().get(baseURI).then().extract().response();jsonPath JsonPath = response.jsonPath();int count = jsonPath.getInt("Search.size()");字符串id = "tt1634278";for(int i=0;i
输出:
ID tt7713068出现在列表中,电影的名字是“猛禽:哈利奎因
的幻想解放”
https://stackoverflow.com/questions/60992591
复制相似问题