Get Last Failed Scenarios of a Test Plan
10 min
this endpoint retrieves the last failed scenarios and their test results for a specific test plan the user must have the necessary test result view authority to access this endpoint endpoint information url https //testinium io/testinium restapi/api/plans/{planid}/lastfailedscenarios method get authentication required ( bearer token ) path parameters parameter type required description planid long yes the unique id of the test plan to fetch the last failed scenarios for response body \[ { "scenario" { "id" 23526, "type" "selenium", "scenario name" "@apiownocon", "enabled" true, "deleted" false, "execute mode" "automated", "source file" "servisakislari/apitest spec", "project id" 1453, "plans" \[3353], "parameterized" false, "has parameterized class" false, "created at" "2025 01 13t08 18 00z", "updated at" "2025 01 13t08 18 00z", "created by" "mehmetaksahin", "updated by" "mehmetaksahin", "java test class" "servisakislari apitest", "java test methods" "@apiownocon", "test scenario java parameters" \[], "group" false }, "test results" \[ { "id" 3545263, "level" "error", "runtime" 3835, "environment" { "id" 440, "name" "chrome", "operating system" "win10", "browser type" "chrome", "environment type" "chrome", "environment version" "latest", "enabled" true, "operating system clean name" "windows 10", "mobile" false }, "session id" "41504966335910929810", "message" "test report could not be found please check your executor log ", "screenshots enabled" false, "screen shot type" "no", "video enabled" false, "performance data enabled" false, "issue tracker key" "bcb 2", "test key" "test c5267 p3353 e274063 s23526 env 440 win10 chrome latest", "video format" "flv", "node log path" "https //testinium dev cloud s3 amazonaws com/5267/2025/01/13/41504966335910929810/node log", "executor log path" "https //testinium dev cloud s3 amazonaws com/5267/2025/01/13/41504966335910929810/testresult log", "screen resolution" "1024x768", "user id" 5322, "project id" 1453, "plan id" 3353, "scenario id" 23526, "execution id" 274063, "company id" 5267, "user info" { "id" 5322, "name" "mehmet", "surname" "aksahin", "username" "mehmetaksahin", "email" "mehmet aksahin\@testinium com", "enabled" true, "account non expired" true, "account non locked" true, "credential non expired" true, "language" "english", "time zone" "utc", "company" "mehmetaksahin", "company id" 5267, "current company" "mehmetaksahin", "current company id" 5267, "roles" \[ "role user", "role run test", "role admin", "role company admin", "role report", "role integration", "role change user" ], "access token" "b0fa2cca656533bb82e5978f677b4b4a" }, "start date" "2025 01 13t08 54 49z", "end date" "2025 01 13t08 54 53z" } ] }, { "scenario" { "id" 23527, "type" "selenium", "scenario name" "@apirtnocon", "enabled" true, "deleted" false, "execute mode" "automated", "source file" "servisakislari/apitest spec", "project id" 1453, "plans" \[3353], "parameterized" false, "has parameterized class" false, "created at" "2025 01 13t08 18 00z", "updated at" "2025 01 13t08 18 00z", "created by" "mehmetaksahin", "updated by" "mehmetaksahin", "java test class" "servisakislari apitest", "java test methods" "@apirtnocon", "test scenario java parameters" \[], "group" false }, "test results" \[ { "id" 3545264, "level" "error", "runtime" 3921, "environment" { "id" 440, "name" "chrome", "operating system" "win10", "browser type" "chrome", "environment type" "chrome", "environment version" "latest", "enabled" true, "operating system clean name" "windows 10", "mobile" false }, "session id" "51862876213391696727", "message" "test report could not be found please check your executor log ", "screenshots enabled" false, "screen shot type" "no", "video enabled" false, "performance data enabled" false, "test key" "test c5267 p3353 e274063 s23527 env 440 win10 chrome latest", "video format" "flv", "node log path" "https //testinium dev cloud s3 amazonaws com/5267/2025/01/13/51862876213391696727/node log", "executor log path" "https //testinium dev cloud s3 amazonaws com/5267/2025/01/13/51862876213391696727/testresult log", "screen resolution" "1024x768", "user id" 5322, "project id" 1453, "plan id" 3353, "scenario id" 23527, "execution id" 274063, "company id" 5267, "user info" { "id" 5322, "name" "mehmet", "surname" "aksahin", "username" "mehmetaksahin", "email" "mehmet aksahin\@testinium com", "enabled" true, "account non expired" true, "account non locked" true, "credential non expired" true, "language" "english", "time zone" "utc", "company" "mehmetaksahin", "company id" 5267, "current company" "mehmetaksahin", "current company id" 5267, "roles" \[ "role user", "role run test", "role admin", "role company admin", "role report", "role integration", "role change user" ], "access token" "b0fa2cca656533bb82e5978f677b4b4a" }, "start date" "2025 01 13t08 54 58z", "end date" "2025 01 13t08 55 02z" } ] } ] response field tables scenario object field type description id long the unique id of the scenario type string the type of the scenario (e g , selenium ) scenario name string the name of the scenario enabled boolean indicates if the scenario is active deleted boolean indicates if the scenario is deleted execute mode string the execution mode (e g , automated ) source file string the source file associated with the scenario project id long the id of the project containing the scenario plans array list of associated plan ids created at string the creation timestamp of the scenario updated at string the last update timestamp of the scenario created by string the user who created the scenario java test class string the associated java test class java test methods string the associated java test methods test results object field type description id long the unique id of the test result level string the severity level (e g , error ) runtime integer the execution runtime in milliseconds environment id long the id of the execution environment environment name string the name of the environment (e g , chrome ) environment operating system string the operating system of the environment message string the error message from the test result node log path string url to the node log file executor log path string url to the executor log file start date string the start timestamp of the test execution end date string the end timestamp of the test execution error codes http code error message description 400 bad request test plan not found ! 403 access denied the user does not have the necessary authority to view test results 500 system internal error an unexpected error occurred while processing the request example request curl location request get "https //testinium io/testinium restapi/api/plans/{planid}/lastfailedscenarios" \\ \ header 'authorization bearer \<your access token>'