Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Hands-On Automated Testing with Playwright
  • Table Of Contents Toc
Hands-On Automated Testing with Playwright

Hands-On Automated Testing with Playwright

By : Faraz K. Kelhini, Butch Mayhew
close
close
Hands-On Automated Testing with Playwright

Hands-On Automated Testing with Playwright

By: Faraz K. Kelhini, Butch Mayhew

Overview of this book

Hands-On Automated Testing with Playwright draws from Faraz and Butch’s extensive experience to help you harness the full potential of Microsoft's Playwright framework. The book begins with a quick setup refresher, walking you through intermediate and advanced concepts such as dynamic content handling, accessibility testing, AI-generated test scripts, and parallel test execution. You'll explore real-world applications with end-to-end testing workflows for e-commerce and single-page applications. Alongside traditional topics such as accessibility, mobile, and visual regression testing, this book delves into modern trends such as CI/CD pipelines, DevOps integration, and AI-driven testing enhancements. Each chapter is packed with practical examples, expert techniques, and performance optimization tips, helping you gain a deep understanding of maintainable automation strategies. Whether you're transitioning from manual testing or expanding your automation toolbox, this Playwright book provides the skills and confidence to build future-proof testing systems in today's complex web development landscape. *Email sign-up and proof of purchase required
Table of Contents (22 chapters)
close
close
20
Other Books You May Enjoy
21
Index

Handling Shadow DOM Components

In web development, Shadow DOM lets you encapsulate parts of the DOM (like custom components) so their styles and elements don't accidentally interfere with the rest of the page. This makes it a bit tricky to access or interact with those nested elements using traditional DOM selectors. Let’s take a look at ways to pierce through this boundary and interact with these encapsulated elements.

Locating the Host Element

This is often the most direct way to access elements within a Shadow DOM. You first locate the host element that has the Shadow DOM. From this root locator, you can then query for elements within it using standard Playwright locators.Let's imagine you have a custom web component like this:

<my-widget>
  #shadow-root
    <div class="internal-button">Click me!</div>
    <style>
      .internal-button { color: blue; }
    </style>
</my-widget>

Here's how you'd interact with...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Hands-On Automated Testing with Playwright
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon