Ask a Question

Where do we use Chrome driver in ReadyAPI Test for API testing??

ramaG
Contributor

Where do we use Chrome driver in ReadyAPI Test for API testing??

Hello ,

Where do we use Chrome driver in ReadyAPI Test for API testing??

Does ReadyAPI Docker image uses chrome driver for API calls?

 

Appreciate any help!

3 REPLIES 3
richie
Community Hero

I juHey @ramaG 

 

Whether you use docker containers or not isn't the determining factor whether you use the chrome driver.  Chrome Driver is for use in UI tests (think!  Chrome Driver means you have the Chrome browser) - have a look at the following link which discusses running Selenium tests in ReadyAPI! - although I've got to say - I never understood why you'd want to - there must be positives to doing it - I just cant see what they are - as far as I can tell running Selenium tests via ReadyAPI just adds an additional level of complication.

 

Anyway - have a look here - it should start you off -->  https://support.smartbear.com/readyapi/docs/integrations/selenium/index.html

 

I just re-read your description - so to answer your question -no you wouldnt use a chrome driver with ReadyAPI to do API testing - it's to allow I suppose a consistent UI to your testing so you can have a single UI to deal with both you front end automation as well as your API testing.

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

Thanks for the reply.

ReadyAPI Docker image needs Chrome driver. I think it somehow uses it for the API calls.

 

One thing I'm curious about. When ReadyAPI connects to an API using REST protocol over https what does the webserver think the client app is? Does it think it is Chrome?

Thanks!

richie
Community Hero

Hey @ramaG 

 

regarding the chrome driver in the ReadyAPI! docker image - if you think back to any front end automation (Selenium) you've done - you always specify the browser driver (chrome, firefox, etc.) as one of the first things as you need the drivers in place so that your code can interact with the browser - you never need a browser driver in your ReadyAPI! tests if doing API testing - perhaps if youre using the 'discovery' function - but even then - that just identifies stuff you need for your API tests - you would never need the browser driver for your API tests as you're tests, depending on what youre testing, are actually spoofing the calls from a browser.....so why would you need browser driver if not using a browser?  You wouldn't! 🙂  Most likely the chrome driver is included in the ReadyAPI docker image to support the option of running Selenium tests (front end automation) via ReadyAPI! or discovery.

 

In regards to your second question - there is an HTTP header called User-Agent.  Postman always includes this header in its requests by default - in other tools the User-Agent header isn't included UNLESS manually added to the request.

You have to remember that not all REST calls are spoofing a browser call. In fact, I'd say the majority of my API testing isnt emulating a web app call (so not spoofing a browser).  Quite often with microservices testing, youre not actually spoofing a browser call - and so the endpoint you're hitting doesnt necessarily care about what agent is hitting it.  If you consider a REST request within your ReadyAPI! tests - think about the whole content of the request.  You have some header parms, a URI (with either matrix (never used em), URI and Query parms) and a payload.  That's it. The listening endpoint isnt cognizant of the agent sending the request (unless you add in a User-Agent header) cos quite often for microservices testing - you're testing internal calls.

 

Hope my explanation was clear!

 

nice one,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: