Web services testing using Webdriver(SE) - testing

Can we use selenium webdriver to test API. For example if we fill sign up form than can we check that API is called properly and the parameter we pass at sign up page are transfer at the web services?

No, Selenium webdriver is not supposed to test APIs. Yes but there are workaround you can do it in indirect way. But I'd suggest to use the tool which is meant to test APIs. There are few open source Java based DSL which you can use along with selenium.
One of them is Rest Assured.
Personally I liked this tool and integrated it with my selenium project. I use selenium to perform all the front-end operations which are required to call APIs.

Related

Automate Functional Testing for web applications to surpass biometrics

I have a scenario where I want to automate my functional tests from the UI for a web application. Had it been simple I would have used a karate/similar framework to get the work done. The main caveat is to surpass the biometric scan in order to complete the functional tests. I know appium supports such a case for the mobile-native/ hybrid applications. But i want to know what are all the other tools that i can use to automate the same for a plain web applications. Thanks in advance.

Is there a testing framework that will support GraphQL, web app testing, and mobile?

I have started to use Karate to test our mobile app which is using GraphQL and it is working good so far, though a bit of a learning curve for me as I am not a programmer by trade, but I need to look further into the future and be sure to find a framework that will also support our need to automate tests for our custom web applications as well. I would think Selenium would be the way to go so I am looking for a testing framework where I can test not only the GraphQL queries which our micro services/APIs are written, but also our web applications and our mobile app. We are a MS shop but if need be, as with Karate, we can venture into a different stack. Thanks!
Disclaimer: dev of Karate here.
I don't know about mobile, but teams have been successful mixing Karate and Selenium / WebDriver into a single integrated script, which is possible because of Karate's Java inter-op.
This is a Stack Overflow answer recommending the above approach and this answer is an update from the same team reporting success.
One more reason you may want to consider Karate is that it may be the only framework that allows you to re-use functional test scripts as performance tests, via Gatling integration (still in development).
Karate in my opinion is a "safe" choice as a testing framework, because it is technically Gherkin and "language neutral". This may be a surprise for those new to Karate, but it actually leans towards using JavaScript for scripting instead of Java.
Of course, it is worth mentioning that I have yet to find a framework that makes testing GraphQL as easy as how Karate does.
Selenium and Rest assured integration framework is the answer to your question. I created a test automation framework to test an ionic application which is using GraphQL api along with Rest webservices. I have used Testng and cucumber in my framework to perform web app side validations and used Rest assured along with GSON to validate the GraphQL and rest services. You can easily integrate appium in your framework along with selenium and rest assured to cater the need of mobile testing.

What are ESB test automation specific tools?

Give some examples for test automation tools used for testing an ESB?
Can Selenium be used for testing or are there any specific tools?
I believe Citrus is the standard in ESB automation testing. While I am not as familiar with Selenium, since it is browser automation, at a minimum it can be used for REST based service testing, as this can be done thru a typical browser without additional support.
Google Chrome Postman with jetpack can do both REST and SOAP.

Web Services Automation Testing using Selenium

i would like to perform webservices testing( WSDL or REST Services) using selenium , ca anyone help me with this?
Don't use Selenium to test these things. Selenium is useful for automating the UI that interacts with said REST or WSDL services. It (Selenium) should not be used for automating the services themselves.
Instead, use something like jMeter, SoapUI or even curl

RESTful API Testbed with Swagger

I'm trying to develop an automated testing suite for a REST API. I've been told that Swagger would be the right tool to use to do this.
The API is being developed using the Spring Framework.
I can't figure out how I would use Swagger to do this.
From my understanding Swagger is used to create nice API documentation.
I've looked at this Dreamfactory blog post and it looks like they've got some kind of in browser testing functionality, but I don't think its really a test suite.
I've also taken a look at ServiceStack( and cucumber) but since its another framework I don't think it would work.
This google group discussion didn't see to point anywhere in particular either.
So, does anyone know how to develop a RESTful API testbed using Swagger?
Thanks!
As the other answers have mentioned, Swagger provides a way to define and document your API endpoints, methods, responses, errors, and more. It does not do any sort of automated testing out of the box.
There are a few tools that can read a Swagger definition to created automated tests, though:
Assertible is a tool where you can import your Swagger spec to automatically create tests and assertions for every endpoint and method. You can then set up monitoring, post deployment testing, and alerts. (Read the blog Testing an API using Swagger). It has a free plan with options to upgrade for more tests.
swagger-test is an NPM package, if you're looking for something to integrate with your code. I haven't personally used it, but it does look active and useful.
Dredd is another really cool open-source tool that will automate testing your Swagger spec against a live backend. This is also a CLI too, and it works with API Blueprint in addition to Swagger.
There's others as well, because Swagger provides a good common language for API developers there's some great tools that are written on top of it.
Another answer mentioned to check out the Commercial Tools page on swagger.io, which has some more hosted services (free and paid).
Full disclosure - I'm one of the co-founders of Assertible and would love to hear your feedback if you get a chance to use it.
Swagger will let you nicely document your API, and will help you do manual, live tests with swagger-ui in that you can easily fill in arguments and see the responses through a web ui. Try the Swagger demo as an example of what I am referring to. http://petstore.swagger.io/
I have not tried this, but this might be of interest for more automated testing against Swagger definitions.
https://github.com/Maks3w/SwaggerAssertions
You can find a lot of software using Swagger specification for (automated) testing of your REST API on http://swagger.io/commercial-tools/. But they are not free.
Postman is great tool to test with Swagger apis. It can also store requests and responses. More details as follows
https://www.getpostman.com/docs/importing_swagger.
You might also want to look at the community tools according to languages at this page. http://swagger.io/open-source-integrations/
I have written an article on how you can generate all the test logic by using the Swagger or OpenAPI specifications. And then feed test data through excel sheets. That way your test data and test logic remain separated and in future if your Swagger spec changes then you will be able to even quickly re-sync the test logic.