<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.33 and v1.32]</li>
<li>Operating System: [Windows 11, Ubuntu 20]</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, expect } from '@playwright/test';

test('keyboard', async ({ page }) =&gt; {
  // await page.goto('https://www.keyboardtester.com/tester.html');
  // await page.goto('https://keyboard-test.space/');
  // await page.goto('https://en.key-test.ru/');
  // await page.goto('https://www.onlinemictest.com/keyboard-test/');

  await page.goto('https://www.rapidtables.com/tools/notepad.html');
  // await page.goto('https://www.memonotepad.com/');
  // await page.goto('https://justnotepad.com/');
  // await page.goto('https://www.online-notepad.net/');

  await page.waitForLoadState();
  await page.keyboard.press('Shift+r');

  await page.screenshot({ path: 'screenshot1.png' })
  
});

"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</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-en">test</span><span class="pl-kos">(</span><span class="pl-s">'keyboard'</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">// await page.goto('https://www.keyboardtester.com/tester.html');</span>
  <span class="pl-c">// await page.goto('https://keyboard-test.space/');</span>
  <span class="pl-c">// await page.goto('https://en.key-test.ru/');</span>
  <span class="pl-c">// await page.goto('https://www.onlinemictest.com/keyboard-test/');</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">'https://www.rapidtables.com/tools/notepad.html'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-c">// await page.goto('https://www.memonotepad.com/');</span>
  <span class="pl-c">// await page.goto('https://justnotepad.com/');</span>
  <span class="pl-c">// await page.goto('https://www.online-notepad.net/');</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">waitForLoadState</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-c1">keyboard</span><span class="pl-kos">.</span><span class="pl-en">press</span><span class="pl-kos">(</span><span class="pl-s">'Shift+r'</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">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">'screenshot1.png'</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">I'm not sure if this is a valid bug. Hopefully someone could shed your light on it. Thank you.</p>
<p dir="auto">We are now testing an internal map tool on web with canvas element, with lots of keyboard shortcut for users.<br>
Unfortunately exposure is not allowed so difficult for reproduction.</p>
<p dir="auto">The symptom is that when we press Shift plus a character(let's say 'r'), it always triggers Shift+r and then r.</p>
<ul dir="auto">
<li>Reproducible on Windows 11 desktop, Ubuntu 20 container and Playwright v1.33/1.32(earlier version not tested).</li>
<li>NOT reproducible for human user, and step over debug mode. So I guess it's related to keyboard timing.</li>
</ul>
<p dir="auto">I tried above sample code on some keyboard test and notepad sites.</p>
<ul dir="auto">
<li>All the keyboard test sites recorded both Shift key and r key.</li>
<li>But all notepad sites only recorded 'r'. This seems related to my scenario. Should they record 'R'?</li>
</ul>
<p dir="auto">Thank you.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.34 / latest]</li>
<li>Operating System: [Windows 10]</li>
<li>Browser: [ Chromium]</li>
<li>Other info: codegen only</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" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto">** Shell command **</p>
<p dir="auto"><code class="notranslate">npx playwright@latest codegen https://saw.trixti.com.br/saw</code></p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li><code class="notranslate">npx playwright@latest codegen https://saw.trixti.com.br/saw</code> or <code class="notranslate">npx playwright codegen https://saw.trixti.com.br/saw</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">I could use codegen features (record, pick locator etc)</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Codegen is unusable. The site triggers alerts with text  "TypeError: cache.has is not a function (Page: - Line: 399)"  in loop: i click ok a new alert appears</p>
<p dir="auto"><strong>More Info</strong></p>
<p dir="auto">Its specific for codegen . Using the playwright library/automation or directly in browser works without issues</p>
<p dir="auto">The page has the following DOCTYPE:<br>
<code class="notranslate">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</code></p>
<p dir="auto">Looking at call stack, the error is triggered by a function of the Recorder. Yesterday when i first spotted the error i could inspect the callstack. Today the callstack is not show in the devtools</p>