<p dir="auto">Getting error - Error: browserType.launch: spawn UNKNOWN when I try to execute example.spec.ts<br>
I've the latest version of playwright and chrome browser<br>
playwright version - 1.36.1<br>
chrome version - 115.0.5790.110</p>




<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.XX]</li>
<li>Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto">[https://github.com/your_profile/playwright_issue_title]</p>
<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'], },
    },
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos"></span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="it('should check the box using setChecked', async ({ page }) =&gt; {
  await page.setContent(`&lt;input id='checkbox' type='checkbox'&gt;&lt;/input&gt;`);
  await page.getByRole('checkbox').check();
  await expect(page.getByRole('checkbox')).toBeChecked();
});"><pre class="notranslate"><span class="pl-en">it</span><span class="pl-kos">(</span><span class="pl-s">'should check the box using setChecked'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">setContent</span><span class="pl-kos">(</span><span class="pl-s">`&lt;input id='checkbox' type='checkbox'&gt;&lt;/input&gt;`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'checkbox'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">check</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'checkbox'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBeChecked</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Run the test]</li>
<li>[...]</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">[Describe expected behavior]</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">[Describe actual behavior]</p>
<p dir="auto">When the first test file finished and the next test file starts the first test of the next test file always fails:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/43057926/232991638-31142180-3b23-4b6f-b3a6-b87a777e90de.png"><img src="https://user-images.githubusercontent.com/43057926/232991638-31142180-3b23-4b6f-b3a6-b87a777e90de.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Having this workaround in the concerning test file:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//testfile.spec.ts
import { adminTest as test } from &quot;fixtures/base&quot;;

test('DUMMY @LEVEL1', async ({ page }) =&gt; {
  //Here nothing happens
})


test(&quot;The actual test @LEVEL1&quot;, async ({
  page,
}, testInfo) =&gt; {
...
});"><pre class="notranslate"><span class="pl-c">//testfile.spec.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">adminTest</span> <span class="pl-k">as</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"fixtures/base"</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'DUMMY @LEVEL1'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-c">//Here nothing happens</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>


<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"The actual test @LEVEL1"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>
  page<span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">testInfo</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
...
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">everything works fine.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.31</li>
<li>Operating System: Windows10</li>
<li>Browser: Chromium</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>fixture</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//base.ts

base.use({ baseURL: process.env.URL });
const authAdmin = process.env.AUTH_ADMIN;
export const adminTest = base.extend({
  page: async ({ browser }, use) =&gt; {
    const context = await browser.newContext({
      storageState: authAdmin,
    });
    const page = await context.newPage();
    await page.goto(&quot;&quot;);
    await use(page);
  },
});"><pre class="notranslate"><span class="pl-c">//base.ts</span>

<span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">baseURL</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">URL</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">authAdmin</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">AUTH_ADMIN</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">adminTest</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-en">page</span>: <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> browser <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
      <span class="pl-c1">storageState</span>: <span class="pl-s1">authAdmin</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from &quot;@playwright/test&quot;;

// JUnit reporter config for Xray
const xrayOptions = {
  // Whether to add &lt;properties&gt; with all annotations; default is false
  embedAnnotationsAsProperties: true,

  // By default, annotation is reported as &lt;property name='' value=''&gt;.
  // These annotations are reported as &lt;property name=''&gt;value&lt;/property&gt;.
  textContentAnnotations: [&quot;test_description&quot;],

  // This will create a &quot;testrun_evidence&quot; property that contains all attachments. Each attachment is added as an inner &lt;item&gt; element.
  // Disables [[ATTACHMENT|path]] in the &lt;system-out&gt;.
  
  //Issue bzgl. Daten-Typen, siehe https://github.com/microsoft/playwright/issues/22396
  embedAttachmentsAsProperty: &quot;testrun_evidence&quot;,

  // Where to put the report.
  outputFile: &quot;./test-results/xray-report.xml&quot;,
};

export default defineConfig({
  testDir: &quot;./tests&quot;,
  grepInvert: /@TODO/,
  timeout: 60 * 1000,
  expect: {
    timeout: 5000,
  },
  fullyParallel: false,
  retries: 0,
  workers: 1,
  reporter: [
    [&quot;html&quot;, { open: &quot;on-failure&quot; }],
    [&quot;list&quot;, { printSteps: true }],
    [&quot;junit&quot;, xrayOptions],
  ],

  use: {
    actionTimeout: 0,
    trace: &quot;retain-on-failure&quot;,
    video: &quot;retain-on-failure&quot;,
    screenshot: &quot;only-on-failure&quot;,
    headless: true,
    locale: &quot;de-DE&quot;,
    timezoneId: &quot;Europe/Berlin&quot;,
  },

  projects: [
    { name: &quot;setup&quot;, testMatch: /.*\.setup\.spec.ts/ },
    {
      name: &quot;chromium&quot;,
      use: { ...devices[&quot;Desktop Chrome&quot;] },
      dependencies: [&quot;setup&quot;],
    },
  ],
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>

<span class="pl-c">// JUnit reporter config for Xray</span>
<span class="pl-k">const</span> <span class="pl-s1">xrayOptions</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c">// Whether to add &lt;properties&gt; with all annotations; default is false</span>
  <span class="pl-c1">embedAnnotationsAsProperties</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>

  <span class="pl-c">// By default, annotation is reported as &lt;property name='' value=''&gt;.</span>
  <span class="pl-c">// These annotations are reported as &lt;property name=''&gt;value&lt;/property&gt;.</span>
  <span class="pl-c1">textContentAnnotations</span>: <span class="pl-kos">[</span><span class="pl-s">"test_description"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>

  <span class="pl-c">// This will create a "testrun_evidence" property that contains all attachments. Each attachment is added as an inner &lt;item&gt; element.</span>
  <span class="pl-c">// Disables [[ATTACHMENT|path]] in the &lt;system-out&gt;.</span>
  
  <span class="pl-c">//Issue bzgl. Daten-Typen, siehe https://github.com/microsoft/playwright/issues/22396</span>
  <span class="pl-c1">embedAttachmentsAsProperty</span>: <span class="pl-s">"testrun_evidence"</span><span class="pl-kos">,</span>

  <span class="pl-c">// Where to put the report.</span>
  <span class="pl-c1">outputFile</span>: <span class="pl-s">"./test-results/xray-report.xml"</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">testDir</span>: <span class="pl-s">"./tests"</span><span class="pl-kos">,</span>
  <span class="pl-c1">grepInvert</span>: <span class="pl-pds"><span class="pl-c1">/</span>@TODO<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
  <span class="pl-c1">timeout</span>: <span class="pl-c1">60</span> <span class="pl-c1">*</span> <span class="pl-c1">1000</span><span class="pl-kos">,</span>
  <span class="pl-c1">expect</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">timeout</span>: <span class="pl-c1">5000</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
  <span class="pl-c1">retries</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-c1">workers</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span>
  <span class="pl-c1">reporter</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">"html"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">open</span>: <span class="pl-s">"on-failure"</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">[</span><span class="pl-s">"list"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">printSteps</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">[</span><span class="pl-s">"junit"</span><span class="pl-kos">,</span> <span class="pl-s1">xrayOptions</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>

  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">"retain-on-failure"</span><span class="pl-kos">,</span>
    <span class="pl-c1">video</span>: <span class="pl-s">"retain-on-failure"</span><span class="pl-kos">,</span>
    <span class="pl-c1">screenshot</span>: <span class="pl-s">"only-on-failure"</span><span class="pl-kos">,</span>
    <span class="pl-c1">headless</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">locale</span>: <span class="pl-s">"de-DE"</span><span class="pl-kos">,</span>
    <span class="pl-c1">timezoneId</span>: <span class="pl-s">"Europe/Berlin"</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"setup"</span><span class="pl-kos">,</span> <span class="pl-c1">testMatch</span>: <span class="pl-pds"><span class="pl-c1">/</span>.<span class="pl-c1">*</span><span class="pl-cce">\.</span>setup<span class="pl-cce">\.</span>spec.ts<span class="pl-c1">/</span></span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">"chromium"</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">"Desktop Chrome"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-c1">dependencies</span>: <span class="pl-kos">[</span><span class="pl-s">"setup"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>