<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.32.3</li>
<li>Operating System: windows11</li>
<li>Browser: Chromium</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/78466501/234311738-9c99c50b-ad1b-45d7-94ab-92e22b55404d.png"><img width="461" alt="image" src="https://user-images.githubusercontent.com/78466501/234311738-9c99c50b-ad1b-45d7-94ab-92e22b55404d.png" style="max-width: 100%;"></a></p>
<p dir="auto">This happen when I use the codegen to generate script. Like the upon image, for example, I found I has a typo on the word "too", but I can't put the cursor in the middle of the sentence, the cursor can only start from the end of the line. Is there any solution on this situation?</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32.3]</li>
<li>Operating System: [Windows 11]</li>
<li>Browser: [Chromium]</li>
<li>Other info:  Node v16.15.0</li>
</ul>
<ol dir="auto">
<li>It's possible I need to file this bug to MS Teams instead of playwright. Please let me know if I should do so.</li>
<li>I believe this is best reproduced with <code class="notranslate">npx playwright codegen</code> as the only action is to login to teams.</li>
<li>Call is answered properly if it is a direct call to the agent's email address. The bug occurs specifically for MS <a href="https://learn.microsoft.com/en-us/microsoftteams/create-a-phone-system-call-queue?tabs=general-info" rel="nofollow">call queue</a> in combination with playwright.</li>
</ol>
<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. You can also reproduce this with <code class="notranslate">npx playwright codegen</code>.</li>
</ul>




<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';

const config: PlaywrightTestConfig = {
    timeout: 40000,
    expect: {
        timeout: 5000,
    },
    projects: [
        {
            name: 'chromium',
            use: {
                ...devices['Desktop Chrome'],
            },
        },
    ],
};
export default config;"><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">const</span> <span class="pl-s1">config</span>: <span class="pl-v">PlaywrightTestConfig</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">timeout</span>: <span class="pl-c1">40000</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">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>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-s1">config</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('launch MS teams', async ({ page }) =&gt; {
const browser = await chromium.launch({
            headless: false,
            args: ['--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream'], //needed for mic/camera
        });
const context = await browser.newContext();
const page = await context.newPage();

await page.goto('https://teams.microsoft.com/go#'); 
await page.getByPlaceholder('Email, phone, or Skype').fill(YOUR_USERNAME);
await page.getByRole('button', { name: 'Next' }).click();
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(YOUR_PASSWORD);
await page.getByRole('button', { name: 'Sign in' }).click();
await page.getByRole('button', { name: 'No' }).click();


});"><pre class="notranslate"><span class="pl-en">it</span><span class="pl-kos">(</span><span class="pl-s">'launch MS teams'</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">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
            <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">'--use-fake-ui-for-media-stream'</span><span class="pl-kos">,</span> <span class="pl-s">'--use-fake-device-for-media-stream'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">//needed for mic/camera</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">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-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">'https://teams.microsoft.com/go#'</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">getByPlaceholder</span><span class="pl-kos">(</span><span class="pl-s">'Email, phone, or Skype'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">fill</span><span class="pl-kos">(</span><span class="pl-c1">YOUR_USERNAME</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">'button'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Next'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</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">getByPlaceholder</span><span class="pl-kos">(</span><span class="pl-s">'Password'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</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">getByPlaceholder</span><span class="pl-kos">(</span><span class="pl-s">'Password'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">fill</span><span class="pl-kos">(</span><span class="pl-c1">YOUR_PASSWORD</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">'button'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Sign in'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</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">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'button'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'No'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</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 to open an MS Teams instance]</li>
<li>[Configure your MS Teams address to receive a call from an MS <a href="https://learn.microsoft.com/en-us/microsoftteams/create-a-phone-system-call-queue?tabs=general-info" rel="nofollow">call queue</a> ]</li>
<li>[Call the call queue number. This should result in an incoming call on your chromium teams window]</li>
<li>[Manually click the answer button on MS Teams]</li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
[The call establishes and there is an active teams conversation conversation in the Chromium MS Teams tab.]<br>
<strong>Actual</strong><br>
[Observe that the call establishes for a brief moment and is immediately being terminated]</p>