Hi @Jerald Felix Our organisation isn't changing but we are moving between projects under https://dev.azure.com/{your-organization}. Is there going to be a fix to this issue? We have being seeing this issue for the last month or so and as far as I know we haven't changed anything on our company side.
Azure Devops Test Plan Error - Unexpected token ‘<’, “<!DOCTYPE …” is not valid JSON
We are experiencing an issue when trying to attach screenshots during test execution in Azure DevOps Test Plans.
When using the Test Runner and attempting to add a screenshot (via the built-in screenshot button), the following error is displayed:
Unexpected token ‘<’, “<!DOCTYPE …” is not valid JSON Steps to Reproduce Go to Test Plans Open any Test Suite Start test execution using Test Runner During execution, click on the screenshot button (camera icon) Attempt to capture or attach a screenshot Expected Behavior
The screenshot should be successfully attached to the test step or test run without errors.
Actual Behavior
An error message is displayed, and the screenshot is not attached. The system appears to return an HTML response instead of JSON.
Additional Information The issue happens consistently for all QA team members It only occurs during test execution (Test Runner)
Tested across: Multiple browsers (Chrome, Edge) Incognito mode Cache cleared Different users (not permission-related) Impact
This issue is impacting our QA workflow, as we are unable to attach evidence during test execution.
Azure DevOps
2 answers
Sort by: Most helpful
-
Jerald Felix 17,470 Reputation points Volunteer Moderator2026-07-07T14:41:34.26+00:00 Hello Phillipe O.
Greetings! Thanks for raising this question in the Q&A forum.
This error means the browser expected a JSON response from the Test Runner's attachment upload API call, but instead received an HTML page (starting with
<!DOCTYPE). This is not a bug in the screenshot feature itself, it happens when the underlying REST call to attach the file is intercepted or redirected before it reaches the actual API endpoint. The most common causes are an expired or conflicting authentication session, a proxy or firewall returning an HTML error page, or a WAF/CDN blocking the upload request. Since you have already ruled out browser, incognito mode, cache, and per user permissions, the issue likely lies in session handling or network interception rather than your local setup.Inspect the actual failing request Open the browser Developer Tools (F12) before reproducing the issue, go to the Network tab, then click the screenshot button in Test Runner. Find the failing request (it usually targets something like
_apis/test/Session/...attachmentsor similar). Check its HTTP status code and response body. This tells you whether the server returned a 401, 403, 502, or a sign in redirect page, which narrows down the cause considerably.Rule out session conflicts Azure DevOps invalidates the active session if you sign in to a different organization in another tab or window, even unintentionally. Open a new tab, browse to
https://dev.azure.com/{your-organization}confirm you land on the organization home page without being asked to sign in again, then retry the Test Runner action.
Test outside your normal network path If your organization uses a corporate proxy, VPN, or a web application firewall, it may intercept large or specific POST requests to the attachment endpoint and return an HTML error page instead of passing it through. Try reproducing the issue on a network without the corporate proxy (for example mobile hotspot) to confirm whether the network path is the cause.
Check attachment size and content type restrictions Confirm the screenshot capture is not exceeding any configured attachment size limit for your organization. Oversized or unusual content types can sometimes cause an API gateway to reject the request with an HTML error page rather than a JSON error.
Clear stored authentication state Clear cookies and site data specifically for
dev.azure.comandlogin.microsoftonline.com, then sign in again from scratch. A stale or corrupted authentication cookie can also cause the token refresh call itself to be redirected to a sign in page instead of returning JSON.Capture a HAR file for support If the issue persists after the above checks, capture a HAR file of the failing action (Network tab, right click, Save all as HAR with content) and open a support case through Azure DevOps. This is a server side session or gateway routing issue that support engineers can trace using your organization ID and the timestamp of the failed request.
https://azure.microsoft.com/en-us/support/create-ticket/If this answer helps you kindly accept the answer which will help others who have similar questions.
Best Regards,
Jerald Felix.