microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.11k stars 3.69k forks source link

[BUG] Keyboard API class doesn't work with address bar #33717

Open hemanshurana opened 13 hours ago

hemanshurana commented 13 hours ago

Trying to use following code to type in URL bar but seems like it's not working.

I have one usecase. Our company implemented one feature like open browser and type "company name" and space in address bar it will automatic setup company all site and whatever we type then after regarding information it will listed out on page.

So I am trying to open blank web page and type company name and space but seems like it's not working with address bar.

test('has title', async ({ page }) => { await page.goto('https://playwright.dev/'); await page.keyboard.press('Control+d'); await page.keyboard.type('https://www.microsoft.com/en-us/'); await page.keyboard.press('Enter'); });

  1. Page open with playwright URL
  2. All the steps passed but keyboard functionality not working.

I don't know if anything we need to extra configuration in config file or import something that can enable to use keyboard