Karate integration with type config - api

can we use any config framework like type config for java in karate? it can be used to pick up the values of keys mentioned in configuration file as per requirement.we have been using rest assured and type config.

One word of advice is you need to un-learn a lot of "Java things" when you start with Karate. There is no need for type-config. Please see the documentation: https://github.com/intuit/karate#configuration
Also see this example for a example of "picking up keys" like you say: https://stackoverflow.com/a/49693808/143475
If you have a specific need, please ask a new question, and provide good examples. Anything is possible in Karate.

Related

Authorisation Key in Karate API [duplicate]

I would like to update my common headers (Accept and Content-Type) just in one feature file. however, I would like to use Authorization token which already configured in Karate.config.cs file.
Could you please help me with this?
This is explained in detail in the docs: https://github.com/intuit/karate#configure-headers
* configure headers = read('classpath:my-headers.js')
And you can refer to variables declared in karate-config.js anywhere in Karate. Again read the docs, and there are multiple examples. Next time please ask a more specific question: https://stackoverflow.com/help/minimal-reproducible-example

Refference JSON schema from "define" API YAML file in Postman instead of creating a variable with actual JSON

I have an API in Postman that has defined JSON schemas for every request\response.
I also have a collection of tests that i use for testing this API.
But I don't know how to connect these two substances(things)
I have been searching for a solution for quite a while now and havent found an example set-up or a tutorial how? instead of creating a variable with actual schema in my test collection, I want to reuse already existing schema from API by $ref or some other link method.
This is my first question here, writing it just cause i haven't found a proper answer but functionality that i seek sounds really basic and logical.
Update from Valentin Despa:
"Please note that the API definition is written in a specification like Open API (or similar). It is not the same as the JSON schema which refers to the response body only."
So we can't validate response using that schema.

karate api test: how to store all responses of a feature file in an array [duplicate]

Using Karate i am making API calls sequentially. I need to store API request and response for this sequential flow of APIs in separate text files for each API call.
Need to understand how can i achieve this.
I have tried logback which stores entire execution logs in a text file.
Take a look at karate.prevRequest which will give you the "request". Now use some custom Java (or JS) code and write whatever you want to a file.
I think personally it is un-necessary because Karate's HTML report has all that you need. If someone is asking you to do this, please try convince that person that this exercise is a waste of time.

Entering custom data into GraphiQL Docs

I would like to use GraphiQL docs to document my GraphQL API. The out-of-the-box version already looks pretty useful, however I would like to enrich it by the information about permissions.
My imagination is that in this
there will be another section, i.e. "Permissions", with some description of the permissions.
My question: is this the way to do it? If not, how can one express permissions in the GraphiQL Docs? And if this could be the way, is there any tool capable of doing this?
What's shown in GraphiQL (or similar tools like GraphQL Playground, Altair, etc.) is limited to what can be returned through introspection of the schema, which is limited by what the spec specifies. You can add descriptions to types, fields, arguments, enum values and directives. A description for the schema itself is in the works.
At best, you could add a description to your field specifying the permissions. You can use markdown if you want to jazz it up.

Is it possible to look at a URL and determine if it's using Struts?

example:
http://www.boston.com/travel?p1=Levelone_Nav_travel
will we be able to say if this website code is developed using Struts framework ? If so how, details please.
Not necessarily.
The HTTP headers sometimes include relevant information, but not reliably.