Search
  • +44-7459919437 (UK- WhatsApp & Direct Call) | +91-6383544892 (India - WhatsApp Only) | Email Id : vinothrwins@gmail.com
Vinoth Tech Solutions
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • E-Commerce Demo Application
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • E-Commerce Demo Application
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I

Playwright

  • Handle Browser Navigation
  • Playwright Core Concepts
  • First Playwright Program
  • Step-by-Step Node.js Installation on Windows
  • Step-by-Step VS Code Installation on Windows
  • Step-by-Step Playwright Installation on Windows
  • Playwright VS Code extension Installation and Execution
  • Playwright Folder Structure
View Categories
  • Home
  • Tutorials
  • Playwright
  • Playwright
  • Playwright Core Concepts

Playwright Core Concepts

Playwright Core Concepts

What is Synchronous (Sync)?

Meaning: Code runs line by line, one statement must finish before the next starts.

In JS: JavaScript itself is single-threaded, so normally code runs synchronously.

In Playwright: Sync style isn’t natively supported in Node.js because Playwright APIs are asynchronous (they interact with browsers, networks, etc.). But some languages (like Python/Java/.NET) provide synchronous versions of Playwright.

What is Asynchronous (Async)?

Meaning: Code doesn’t wait for the previous line to finish — it can continue executing while waiting for promises to resolve.

In Playwright: All browser operations (click, fill, goto, waitFor, etc.) return Promises. You must use async/await to ensure they complete in order.

Why: Because actions like page load, button click, or locator finding take time and depend on the browser.

What is Arrow function ?

An arrow function is a shorter syntax for writing functions in JavaScript.
Introduced in ES6 (ECMAScript 2015), it makes functions cleaner and more concise.

📄
ArrowFunction.js
// Normal function
function greet(name) {
  return "Hello " + name;
}

// Arrow function
const greet = (name) => {
  return "Hello " + name;
};

// Simplified (One-Line) Arrow Function
const greet = (name) => "Hello " + name;

Arrow Function in Playwright

📄
SamplePlaywrightProgram.spec.js
test('Launch example', async ({ page }) => {
  await page.goto('https://example.com');
});
  • ()=> = Arrow Function (short-hand way to write a function).
  • Common in Playwright test blocks, callbacks, promises.
  • Cleaner, modern way compared to function() { … }.

What is  await ?

await is a JavaScript keyword used inside async functions.

It pauses the function execution until a Promise is resolved (success) or rejected (error).

In Playwright, since every browser action (goto, click, fill, etc.) returns a Promise, await makes sure the step is completed before moving to the next.

Why await is needed in Playwright?

Playwright commands are asynchronous (they talk to a real browser, which takes time). Without await, your test would not wait and would jump to the next step too early.

Example With await

📄
SamplePlaywrightProgram.spec.js
test('With await', async ({ page }) => {

  await page.goto('https://example.com');   // Waits until page fully loads
  await page.click('#login');               // Waits until button click is done
  const title = await page.title();         // Waits until title is fetched
  console.log(title);
  
});

Playwright Tutorials
What are your Feelings

Share This Article :

  • Facebook
  • X
  • LinkedIn
Handle Browser NavigationFirst Playwright Program
© 2018 – 2025 Vinoth Tech Solutions Ltd (UK), Reg. No: 16489105