Playwright Specflow tests are throwing exception in debug mode but not throwing any exception in run mode

46 Views Asked by At

I am running tests in VS-2022 using Specflow and playwright. Below is the scenario happening with me. Debug Mode: While running test in Debug mode few steps are running fine but at one step its directly closing the browser and throwing the exception "An unhandled exception of type 'Microsoft.Playwright.TargetClosedException' occurred in System.Private.CoreLib.dll Target page, context or browser has been closed"

Run Mode: If I am trying to run the same test in normal mode its showing all green but after few steps its showing 0.0s in standard output. Below are the steps.

And I click on "Activation" tab
-> done: ActivationSteps.WhenIClickOnTab("Activation") (1.2s)
When I delete the activation
-> done: Activation.WhenIDeleteActivation() (0.0s)
Then 0 activations are visible in "Activation"
-> done: AcRulesSteps.ThenRulesAreVisibleIn(0, "Activation") (0.0s)

Can someone help me why this is happening?

I tried changing the xpath's.

0

There are 0 best solutions below