package restAssuredTesting;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;
import org.testng.annotations.Test;
public class DemoProjectForGet {
@Test
public void getWhetherDetails() {
given()
.when()
.get("http:/restapi.demoqa.com/utilities/weather/city/Mumbai")
.then()
.statusCode(200)
.statusLine("HTTP/1.1 200 OK")
.assertThat().body("City", equalTo("Mumbai"))
.header("Content-Type", "application/json");
}
}
Asked
Active
Viewed 89 times
1

John Humphreys
- 37,047
- 37
- 155
- 255

kishan kulkarni
- 23
- 3
1 Answers
1
You're missing a slash in http://.
.get("http:/restapi.demoqa.com/utilities/weather/city/Mumbai")
It should be:
.get("http://restapi.demoqa.com/utilities/weather/city/Mumbai")

John Humphreys
- 37,047
- 37
- 155
- 255
-
1Ohh yes it is working fine now. Thank you so much, sir. – kishan kulkarni Jan 07 '20 at 18:57
-
Happy to hear it :). You can click the check mark to close out the question. – John Humphreys Jan 07 '20 at 19:46