Test Case Execution Fails With Forbidden Exception

While test Robots execute a Test process, it fails with:"Operation returned an invalid status code 'Forbidden' at UiPath.Web.Client20_10.TestAutomation."

Error Message:

  • Error: {"message":"You are not authorized!","errorCode":0,"result":null,"targetUrl":null,"success":false,"error":{"code":0,"message":"You are not authorized!","details":"You are not allowed to perform this operation.","validationErrors":null},"unAuthorizedRequest":true,"__abp":true}

Root Cause:

  • Missing Robot Role for the account intended to run the execution.
Or
  • If the Robot role is assigned, it has no "create" permissions for the object "Test case execution artifacts". Thus pointing to a lack of permissions.



Resolution:

  1. Assign the Robot role to the account executing the test project
  2. From the Robot role folder permissions section, enable the object "Test Case Execution Artifacts" and give it the "Create" permissions.