1

I am testing for preemptive authorization using BDD for API automation using Rest assured. Is this the correct syntax?

given().get("url").when().auth("username","pwd").then().assertthat().statuscode(200)

Can I write get() after given() or should it be in when()?

1 Answers1

0

Try this, it works for me when i use this with Testng.

httpreq.auth().preemptive().basic("ToolsQA", "TestPassword");
        reponse = httpreq.request(Method.GET,"/authentication/CheckForAuthentication");

Thanks for Asking,

koushick
  • 497
  • 2
  • 8
  • 30