Xray API using Postman

Shayne Vandersloot June 16, 2022

Hello,

I'm familiarizing myself with the Xray APIs to import automation test results using Postman first and then would like to move it to our framework. I'm currently running into the error below.

{
    "info": "Invalid Parameters - /import/execution/cucumber",
    "errors": [
        "body[]: Invalid value"
    ]
}
I'm providing the below in postman for the URI and body. I can use this very same data in the cucumber report json file and successfully import results manually to an existing Test Execution but have had no luck via API. Do you see anything wrong with the below request? Any help is greatly appreciated.
[
{
"name": "API Test - Create an mFleet policy for states via API using data table",
"description": "",
"id": "api-test---create-an-mfleet-policy-for-states-via-api-using-data-table",
"keyword": "Feature",
"uri": "file:src/test/resources/guidewire/features/mFleet/inshare/GWPCv1/Generic/APITest.feature",
"tags": [],
"line": 4,
"elements": [
{
"line": 32,
"name": "Create an mFleet policy for FL state via API using data table Stepdefinition",
"description": "",
"id": "api-test---create-an-mfleet-policy-for-states-via-api-using-data-table;create-an-mfleet-policy-for-\u003cstate-code\u003e-state-via-api-using-data-table-stepdefinition;;2",
"type": "scenario",
"keyword": "Scenario Outline",
"steps": [
{
"result": {
"duration": 4879000,
"status": "passed"
},
"line": 8,
"name": "I set below Test Variables",
"match": {
"location": "ApiStepDefinitions.setTestVariables(DataTable)"
},
"rows": [
{
"cells": [
"TestVariableName",
"Value"
]
},
{
"cells": [
"product",
"mfleet"
]
},
{
"cells": [
"stateCode",
"FL"
]
},
{
"cells": [
"pcUserRole",
"producer"
]
}
],
"keyword": "Given "
},
{
"result": {
"error_message": "java.lang.AssertionError: {\"userMessage\":\"Entity validation errors block \u0027quote\u0027 action\",\"errorCode\":\"gw.api.rest.exceptions.BadInputException\",\"details\":[{\"message\":\"Uninsured Motorists Coverage: The coverage term \u0027Uninsured Motorists Coverage Type\u0027 is required. Enter a value.\",\"properties\":{\"severity\":\"error\",\"id\":\"CA7VehicleUninsuredMotoristPolicy\",\"type\":\"CA7JurisdictionCoverage\",\"url\":\"/job/v1/jobs/pc:144795/lines/CA7Line/jurisdictions/200539/coverages/CA7VehicleUninsuredMotoristPolicy\"}},{\"message\":\"Truck Liability: The coverage term \u0027Liability Limit\u0027 is required. Enter a value.\",\"properties\":{\"severity\":\"error\",\"id\":\"CA7VehicleLiabTTT\",\"type\":\"CA7TruckCoverage\",\"url\":\"/job/v1/jobs/pc:144795/lines/CA7Line/trucks/1160626/coverages/CA7VehicleLiabTTT\"}},{\"message\":\"Liability Limits cannot differ between Commercial Auto and Vehicle screens.\",\"properties\":{\"severity\":\"error\",\"type\":\"CA7Line\",\"url\":\"/job/v1/jobs/pc:144795/lines/CA7Line\"}}],\"status\":400}\r\n\tat com.mobilitas.automation.api.services.pc.PolicyCenterApi.checkErrorCode(PolicyCenterApi.java:212)\r\n\tat com.mobilitas.automation.api.services.pc.PolicyCenterApi.postJsonRequest(PolicyCenterApi.java:82)\r\n\tat com.mobilitas.automation.api.services.pc.PolicyCenterApi.postRequest(PolicyCenterApi.java:41)\r\n\tat com.mobilitas.automation.utils.ApiUtilMethods.processApiRequest(ApiUtilMethods.java:576)\r\n\tat com.mobilitas.automation.stepdefinitions.app.api.ApiStepDefinitions.createandProcessRequest(ApiStepDefinitions.java:318)\r\n\tat com.mobilitas.automation.stepdefinitions.app.api.ApiStepDefinitions.processStandaloneRequest(ApiStepDefinitions.java:214)\r\n\tat com.mobilitas.automation.stepdefinitions.app.api.ApiStepDefinitions.processStandaloneRequestWithData(ApiStepDefinitions.java:229)\r\n\tat com.mobilitas.automation.stepdefinitions.app.api.ApiStepDefinitions.processPayloadUsingApi(ApiStepDefinitions.java:88)\r\n\tat ✽.I process GW API requests in the below order(file:src/test/resources/guidewire/features/mFleet/inshare/GWPCv1/Generic/APITest.feature:15)\r\n",
"duration": 11288658400,
"status": "failed"
},
"line": 15,
"name": "I process GW API requests in the below order",
"match": {
"arguments": [
{
"val": "GW",
"offset": 10
}
],
"location": "ApiStepDefinitions.processPayloadUsingApi(String,DataTable)"
},
"rows": [
{
"cells": [
"Transaction",
"Data",
"ExpectedResponseStatus"
]
},
{
"cells": [
"CREATE_ACCOUNT",
"",
"valid"
]
},
{
"cells": [
"CREATE_SUBMISSION",
"POLICY_EFFECTIVE_LESS_01_01_2022",
"valid"
]
},
{
"cells": [
"CREATE_TRUCK",
"VEHICLE_INFO_OWNED_TRUCK",
"valid"
]
},
{
"cells": [
"CREATE_DRIVER",
"DRIVER_DETAILS_AZ",
"valid"
]
},
{
"cells": [
"CREATE_COVERED_SYMBOL_SCHEDULED_ITEM",
"",
"valid"
]
},
{
"cells": [
"SYNC_LINE_COVERAGES",
"",
"valid"
]
},
{
"cells": [
"QUOTE_SUBMISSION",
"",
"valid"
]
},
{
"cells": [
"APPROVE_UW_ISSUE",
"",
"valid"
]
},
{
"cells": [
"UPDATE_PAYMENT_PLAN",
"QUARTERLY",
"valid"
]
},
{
"cells": [
"BIND_AND_ISSUE",
"",
"valid"
]
}
],
"keyword": "Then "
}
],
"tags": [
{
"name": "@MfleetPolicyGWAPIDataTable"
},
{
"name": "@TEST_MOB-38822"
},
{
"name": "@MOB-38823"
}
]
}
]
}
]

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events