Generate Locators in Playwright FAST with This Tool

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

Комментарии • 7

  • @davi.santosz
    @davi.santosz Месяц назад +1

    I’ve been working with Playwright over the past few months and have noticed this frequently. I often have to rely on CSS locators and XPath as a last resort due to this limitation.
    Thanks for sharing!

    • @BondarAcademy
      @BondarAcademy  Месяц назад

      Don't use XPath in the Playwright. It's considered the anti-pattern. Instead, use user-visible locators such as getByRole(). With some practice, you will quickly understand that it's significantly more convenient than XPath. The "SDET with Playwright" course has a separate section on how to find web elements in Playwright following best practices.

  • @Cloudreview-h5d
    @Cloudreview-h5d 2 месяца назад +1

    Really cool,
    How can we do the same using Pycharm?

    • @BondarAcademy
      @BondarAcademy  2 месяца назад

      I am afraid you can't. This is a Playwright plugin for the VS Code, and as far as I know, Playwright does not have plugins for pycharm. But, you still can use a locator picker running the Playwright's UI mode, which I also show in the video.

  • @yusufa3227
    @yusufa3227 2 месяца назад

    Cool. What is this one's advantage over playwright debugger? Which streamlines the locators as a user interaction flow?

    • @BondarAcademy
      @BondarAcademy  2 месяца назад +2

      It's the same functionality, just a different interface. With a debugger you need to run tests running inspector, which is one extra window. With VS Code extension, it's just a little bit more convenient scripting the locator for the next step of the test in my oppinion.