Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

781
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda