Selecting between karate and Rest assured - automation

Trying to select between the Karate framework and Rest Assured for API automation which includes Rest APIs and GraphQL. Also we can enhance the framework to execute the UI automation
I have gone through the general process of finding:
Karate is designed for GraphQL: https://stackoverflow.com/a/47469363/143475
For a comparison of Karate and REST-assured: https://github.com/intuit/karate#comparison-with-rest-assured
UI automation: https://github.com/intuit/karate/tree/master/karate-core
For UI automation, can it be done in the hybrid framework with Rest Assured.
Need to understand what will be the result in long term handling of both the frameworks
Moved the discussion to QA group unless it is ok to discuss here.
https://sqa.stackexchange.com/questions/44538/selecting-between-karate-and-rest-assured

Karate is designed for GraphQL: https://stackoverflow.com/a/47469363/143475
For a comparison of Karate and REST-assured: https://github.com/intuit/karate#comparison-with-rest-assured
And it already supports UI automation: https://github.com/intuit/karate/tree/master/karate-core

Related

Can you use Karate Framework to do Desktop based automation?

My team is using Karate framework for doing UI and API testing. However, we do have some windows desktop-based applications/simulators which we need to interact with for completing end to end automation. Is there a way we can use Karate for desktop-based automation?
Looking for answers on how to achieve Desktop based automation using Karate framework.
The answer is yes. But my recommendation is evaluate it and do a PoC. Because depending on how "automatable" your application is, your mileage may vary. Note that the code is very maintainable - so if you or your team can dig in and contribute, I would say you should seriously consider Karate for Windows desktop automation.
Your starting point should be here: https://github.com/karatelabs/karate/tree/master/karate-robot

Can we automate a sequence of API calls for functional testing using karate framework?

I am currently performing unit testing of rest APIs using karate-framework. Can we automate functional test cases through a sequence of different API calls using karate framework?
The answer is a big YES. Kindly refer to the demo examples, for example - this one: cats.feature.

Need suggestion for API and GUI test automation tool

I have been going through many tool, but not able to conclude.
I have been using HP UFT for sometime and it's quite OK for my project but for some reason we need to find alternative to HPUFT with some advantage.
I have been exploring tool like selenium, IBM tools.soap ui
Could anyone suggest me test automation tool with advantages , so that I can explore.
My scenario,
More REST API based validation.
Need to make REST call and parse the response for validation.
From my experience, it all depends on if you are comfortable coding then you can use REST ASSURED if you are not too comfortable with coding then there are tools like POSTMAN and Ready API (SOAPUI) Which you can automate with very well which comes with loads of assertions.
Since you are testing REST API and validating result, I would not any testing related to UI here. So Selenium ruled out if there is no web UI involved.
For rest API I would recommend you can use Java with Junit/TestNG. Where you write keywords in Java and use the same ones to write Junit/TestNG tests.
Another alternative could be RobotFramework, for which u can have keywords in python.

What are you specifically automating in UI test automation?

All the documents I have read so far on various testing frameworks (Selenium, Tellurium, Canoo etc) encourage (or at least concentrate) on functional testing an application through UI. I have seen very less on the below which I believe are most important ones
localization testing
usability testing
cross browser compatibility testing
testing against multiple versions of the same browser
xss/sql injection
validation
Is the UI/presentation layer calling the correct service layer API (service layer being tested thoroughly through component based testing)
So here are my questions
1) What are you specifically automating in UI test automation?
2) Which UI testing framework can meet all the above items?
I have used Selenium in the past and it works great for all of the 1-7 except maybe localization since I did not have to test that. As 2, the applications I have tested were mostly just "write something in textbox and see if it works", so it was quite easy. And, for 4, I had multiple virtual machines with only specific browsers installed. It was hackjob, but, worked, sort of.
Automation projects till now is not that mature to incorporate all the points you mentioned. Majority cases automation is used to test functionality through UI. Also backed up with unit testing to have more coverage on Functional part.
Framework, there will not be any ready to use framework available. But there are tools which has these capabilities, like eggPlant (TestPlant). Generally industry follows is hybrid kind of automation. Like use jmeter to fire number of REST calls and check response. Which will cover client-server calls. And use selenium kind of tool, to check Client UI.
For Cross browser, cross platforms Selenium Grid with junit framework can be formed easily.

Selenium vs XmlUnit+HttpClient for web REST API testing

I need to test web API functions in REST format. Currently using Selenium RC for functionally testing the website. And using XmlUnit and HttpClient to functionally test our REST API. But it seems life would be easier if we could really separate our functional testing code into all selenium. Particularly with Selenium 2.0's WebDriver, it looks easier than ever to test XML responses using XPath.
My thoughts in the Pro XmlUnit+HttpClient camp:
allows easily testing with direct database calls or Spring beans
more easily allows testing JSON responses when/if we support that in the future
selenium was meant for web UI, not REST API testing
My thoughts in the Pro Selenium WebDriver camp:
separates out the functional testing all into standard selenium tests
easily test results by using our other selenium UI tests, further testing the UI
allows others than core developers to review functional API tests
maybe easier to use services like BrowserMob, which uses selenium tests, to load test API?
hopefully quicker functional tests with selenium framework
We're using Spring 3 and hibernate. What's best for functionally testing our API?
Another option might be to use REST Assured, a Java DSL for testing REST services. It allows you to write unit style tests with little boilerplate code for both XML and JSON. Additionally, it provides more advanced features like authentication, XSD / DTD validation, response codes, cookies, etc. More information is available at their usage page.
Disclaimer: REST Assured is an open source project initiated by a colleague of mine.
If you want to do real functional testing on rest API's, then I can recommend Fitnesse with this fixture: https://github.com/smartrics/RestFixture
Selenium is just a poor choice for this kind of thing.
As for performance testing you can knock up rest API tests in Jmeter in a matter of minutes, no need to pay a 3rd party.
Testing an API does not sound like functional testing but more like unit-testing. So I'd go for XmlUnit+HttpClient