Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

780
Vistas
PlaywrightException: Connection closed (System.Threading.ThreadAbortException: System error - only when debugging

I have some UI test written in MS Test 2 framework.

The test runs fine when I run it from Visual Studio 2022's test explorer.

When I try to debug the test I'm getting:

Microsoft.Playwright.PlaywrightException: Connection closed (System.Threading.ThreadAbortException: System error.
   at System.IO.Strategies.BufferedFileStreamStrategy.WriteToNonSeekableAsync(ReadOnlyMemory`1 source, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.IO.Strategies.BufferedFileStreamStrategy.WriteToNonSeekableAsync(ReadOnlyMemory`1 source, CancellationToken cancellationToken)
   at System.IO.Strategies.BufferedFileStreamStrategy.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)
   at System.IO.FileStream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)
   at Microsoft.Playwright.Transport.StdIOTransport.SendAsync(String message))

  Stack Trace: 
Connection.SendMessageToServerAsync[T](String guid, String method, Object args)
Frame.WaitForFunctionAsync(String expression, Object arg, FrameWaitForFunctionOptions options)
MyTest.MyAsyncMethod() line 23
ThreadOperations.ExecuteWithAbortSafety(Action action)

on following call to WaitForFunctionAsync:

  var jshandle = await Page.WaitForFunctionAsync(script,
                null, 
                new() { Timeout = 5000, PollingInterval = 300 });

The error occurs only if the breakpoint is hit before the call.

I'm experiencing similar behavior with QuerySelectorAsync().

How can I debug playwright tests?!

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda