1
votes

I am working as automation tester for banking domain account. I have a query and need your help.

Current Approach :
1.The framework which we are using for API-Services testing is Java based - Serenity -Cucumber framework using Rest Assured.
2.All the script development/script maintenance activities related to this framework is taken care by the automation testers in our team.
3.Few weeks before , we got to know about Karate framework and completed the PoC( Proof of concept).
4.All went well and we are in the plan to migrate our existing Rest assured java code Karate framework.

The reason for migration - Karate framework Api services testing can be able to do by Manual testers as well.So we are in the plan for migration.

Query

  1. We have almost 80 web services already developed in Rest assured and running successfully.
  2. Also for migration, all the services are inter-dependent. So we have to use both Res-assured and Karate framework code together ,unless it's fully migrated.
  3. Can't able to migrate all the services immediately ,it's a time taken effort.
  4. Is it possible to run karate framework and Rest Assured Java code in the same scenario.

Scnario given in Karate Feature file:
Given urlCustomerservices
When method get
Then status 200

  • def getCustIDfromUserservices=newcallJavaFunction().getcustid("user","password") print getCustIDfromUserservices

This "getcustid" have the Rest assured java code for "Post" call service to get the customer number.

When I am running this in code karate framework , getting this error - "io.restassured.internal.RequestSpecificationIMpl.invokeMethod(java/lang/String;Ljava/lang/object;)Ljava/lang/object;

Could any help in this. Whether can we run both karate and Rest assured code together in same scenario in karate framework . If yes, why am getting this error, when am trying to get the response in Rest assured.

1
@ptrthomas , could you please help.Mugilan K

1 Answers

0
votes

First I'll say that this is not something we claim to support :) So you are on your own.

That said, it sounds like a simple library conflict. My guess is your existing Maven pom.xml has a lot of libraries floating around. You will need to do some investigation and find out what maven exclusions you need to do or which libraries need explicit versions specified. If you are lucky, switching from karate-apache to karate-jersey may do the trick.

Also I strongly recommend creating a Karate quickstart, then adding the extra stuff one by one in "hello world" mode and see what causes the problem. Use the mvn dependency:tree command and see the differences between a Karate project and yours. If you know how to use Maven profiles, that may be one way to go. All the best !

Worst case, fall back to 2 maven modules and run 2 test-suites, it is fine and not the end of the world. You can gradually migrate.

EDIT - also see https://stackoverflow.com/a/65628686/143475