Skip to main content
Question Protected by CommunityBot
Tweeted twitter.com/StackSQA/status/829591678822576129
added 10 characters in body
Source Link
dzieciou
  • 10.5k
  • 9
  • 48
  • 102

I've been automating tests for our restful api's using retrofit and testNG. Basically, I create a POJO-Model... send the request in retrofit and do the assertions on the model.

Example:

public interface GitHubService {
  @GET("/users/{user}/repos")
  List<Repo> listRepos(@Path("user") String user);
}

@Test
public vod testGitHub(){
  Repo repo = GitHubService.listRepos("me").get(0);
  Assert.equals(repo.getRepositoryName(), "MyFirstRepository");
}

I really like the approach, I can easily integrate it into Selenium integration tests.

However, I've noticed a few people want to focus on API Testing with JMeter. I've only used JMeter for load/performance testing... not functional tests.

It seems good for a functional test.. if you only have a handful, but if you have 400-500 test cases.. it seems like a nightmare to maintain.

Can you recommend pros/cons about using JMeter for functional tests, and recommend any other good API test frameworks, unless retrofit already looks good.

I've been automating our restful api's using retrofit and testNG. Basically, I create a POJO-Model... send the request in retrofit and do the assertions on the model.

Example:

public interface GitHubService {
  @GET("/users/{user}/repos")
  List<Repo> listRepos(@Path("user") String user);
}

@Test
public vod testGitHub(){
  Repo repo = GitHubService.listRepos("me").get(0);
  Assert.equals(repo.getRepositoryName(), "MyFirstRepository");
}

I really like the approach, I can easily integrate it into Selenium integration tests.

However, I've noticed a few people want to focus on API Testing with JMeter. I've only used JMeter for load/performance testing... not functional tests.

It seems good for a functional test.. if you only have a handful, but if you have 400-500 test cases.. it seems like a nightmare to maintain.

Can you recommend pros/cons about using JMeter for functional tests, and recommend any other good API test frameworks, unless retrofit already looks good.

I've been automating tests for our restful api's using retrofit and testNG. Basically, I create a POJO-Model... send the request in retrofit and do the assertions on the model.

Example:

public interface GitHubService {
  @GET("/users/{user}/repos")
  List<Repo> listRepos(@Path("user") String user);
}

@Test
public vod testGitHub(){
  Repo repo = GitHubService.listRepos("me").get(0);
  Assert.equals(repo.getRepositoryName(), "MyFirstRepository");
}

I really like the approach, I can easily integrate it into Selenium integration tests.

However, I've noticed a few people want to focus on API Testing with JMeter. I've only used JMeter for load/performance testing... not functional tests.

It seems good for a functional test.. if you only have a handful, but if you have 400-500 test cases.. it seems like a nightmare to maintain.

Can you recommend pros/cons about using JMeter for functional tests, and recommend any other good API test frameworks, unless retrofit already looks good.

Source Link
Will
  • 131
  • 1
  • 3

Automating Restful API -- Tools?

I've been automating our restful api's using retrofit and testNG. Basically, I create a POJO-Model... send the request in retrofit and do the assertions on the model.

Example:

public interface GitHubService {
  @GET("/users/{user}/repos")
  List<Repo> listRepos(@Path("user") String user);
}

@Test
public vod testGitHub(){
  Repo repo = GitHubService.listRepos("me").get(0);
  Assert.equals(repo.getRepositoryName(), "MyFirstRepository");
}

I really like the approach, I can easily integrate it into Selenium integration tests.

However, I've noticed a few people want to focus on API Testing with JMeter. I've only used JMeter for load/performance testing... not functional tests.

It seems good for a functional test.. if you only have a handful, but if you have 400-500 test cases.. it seems like a nightmare to maintain.

Can you recommend pros/cons about using JMeter for functional tests, and recommend any other good API test frameworks, unless retrofit already looks good.