How to intercept the API when mulltiple instance of API exist in the same name #2250
jeevankumar22
started this conversation in
General
Replies: 1 comment 2 replies
-
Have you tried using case 5 at https://docs.taiko.dev/api/intercept/ ? i.e
You can add a condition by inspecting the request. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
End point : https://example.com/questions/config
API : config
Scenario :
When i navigate to my application two API call exist in the same ( config ) , i.e two instance of API with same name
the difference between this two API call is payload
Below is the sample payload of these two instance of API
API call 1 :
Payload :
types: ["modal", "tab", "mobile number", "name", "cost"]
API call 2 :
Payload : ["name", "address"]
Challenge :
When i try to intercept from the tool, its always intercepting the first API call / instance
How do we instruct the taiko to mock the second instance of API / how to instruct taiko to check the header for all the instance of API and intercept the API based on the certain condition
I followed the available methods from the documentation , but couldn't solve this problem , taiko looking API with name , once matching instance is found its trying to intercept, but in my case i want to iterate all the instance of API call and based on the condition it should intercept
Beta Was this translation helpful? Give feedback.
All reactions