I am trying to open the view page source using playwright but cant proceed because of Target closed error. Below is my step or scenario:
- Access the page: https://www.orangehrm.com/
- And press Control U to access View page source.
Here is my code:
import { test, expect } from '@playwright/test';
test('Keywords_Main', async ({ page }) => {
await page.goto('https://www.orangehrm.com/');
page.keyboard.press('Control+U');
});
I am following the playwright documentation for keyboards functions but it seems that my code cant proceed to press the 'Control+U' : Below is the error that I encountered:
keyboard.press: Target closed
test('Keywords_Main', async ({ page }) => {
await page.goto('https://stage-unientwww.euwest01.umbraco.io/');
page.keyboard.press('Control+U');
^
});