Testing / Karate Framework Interview questions
What is the path keyword used for in Karate?
path appends one or more path segments to the current base URL, typically used to build the specific resource path for a request, and can accept multiple comma-separated segments or dynamic variables.
Given url baseUrl And path 'users', userId, 'orders' When method get # results in: GET {baseUrl}/users/{userId}/orders
path is distinct from directly concatenating strings into the URL: it correctly handles slashes between segments regardless of whether the base URL or a variable already has a trailing or leading slash, which avoids a common source of malformed URLs when values are built dynamically from variables.
More Related questions...