In this blog we will be continuing with a few more Google Place API along with some new test using Rest Assured.
I assume you have also gone through my first blog on working with google place
API and have an exclusive API Key to the access server is with you.
Now
in this blog, I would be starting first with Google place Details API.
As
per Specification https://maps.googleapis.com/
is our Base URI,
Whereas
maps/api/place/details/output is resource URI.
Request type is GET and mandatory parameter for accessing API is key and placeid (this place id we already have captured in our last blog).
Along with this I am also
using one optional parameter “fields” for capturing name, rating, and phone
a number of that captured placeid.
First
let’s execute this request through our postman.
As
we can see in output we can get phone number, rating, and name of the
provided placeid.
Now
the same assertions we can build in our rest assured test along with
verification of status code, header and response time.
Below is the Full code Snapshot :
Output
of the above code execution would be :
Finally
lest look into one more Google Place Search API i.e text search Request API.
In
this Request I will search for an address that includes location and radius
parameters to bias the results to a region of interest.
Here
Request type is GET,
BaseURI is https://maps.googleapis.com
and Resource URI is maps/api/place/textsearch/json
Mandatory a parameter is query where we would be providing address along with API key.
I
would also be passing few optional parameters such as location and address
First
let’s execute this request through our postman.
Code
The snapshot in Rest Assured:
Output
of above code execution