Migrate from Selenium to Playwright

Can someone please point me to any step by step guide on how to migrate from selenium java to playwright java?

2 Likes

Hi @kelvin1 - this might sound a good point for an idea that @christianbaumann is having at the moment. He wants to create a tutorial (full day) on “Building a modular GUI Testing Framework in Java” (see his posting on LinkedIn) => 🔗 Christian Baumann on LinkedIn: Dear software testers, I want to create a tutorial (full day) on…

Stay tuned on this topic then :wink:

2 Likes

Hi @alexschnapper, thanks for the shoutout.
Not sure this tutorial will ever come alive, and not sure if it’ll go deep enough to solve (all of) @kelvin1’s issues.

Nevertheless, I’ve heard many good things about ChatGPT when it comes to migrating automated tests from one framework (or language) to another, so you might wanna give that a try.

2 Likes

Hi there!
Looks like, for now, there is no guide for the task like this, but logically, I guess, it should be done with small parts, like:

  • Setting up the playwright
  • Adapting basic common and utility code
  • Adapting first minimal scenario
    After that, step by step, start migration for the next test. A rule of thumb is to develop new tests for Playwright, and migrate tests while fixing old ones. All other tests could leave in parallel with selenium.
    Of course, I don’t know all the context. I’ve done a pet project with tests on Selenide and Playwright in parallel. It was for my learning purpose, but maybe it will be helpful for you.
    GitHub - alexshamrai/testomat_autotests
    Don’t hesitate to ask the details, if it could help you
3 Likes

Hi, thanks a lot for suggestions. I will take them into consideration. One question, do I have to do the migration in the same project in intelij by setting up playwright, create a new branch and do the migration in that new branch? or I need to clone the same project in a new intelij workspace and do the migration there by adapting the common and utility codes first before adapting the tests.

Hi thanks for the ref…

It can be done in the same project (if you don’t have a specific reason to separate them)