simulate click typescript 1

simulate click typescript

let element: HTMLElement = document.getElementsByClassName('btn')[0] as HTMLElement;
element.click();

Here is what the above code is Doing:
1. It’s creating a new browser instance.
2. It’s navigating to the URL of the page.
3. It’s waiting for the page to load.
4. It’s finding the first button on the page and clicking it.

Similar Posts