Question Details

No question body available.

Tags

selenium-webdriver automated-tests browser-automation

Answers (9)

June 24, 2026 Score: 1 Rep: 135,278 Quality: Medium Completeness: 80%

Playwright would help a lot BUT .... flaky tests are usually badly written and designed tests. If you use IDs for example, a change will break your test. If you used a more generic CSS or XPath selector, it would be less likely to break.

That's why patterns like Page Object Models are used both in Selenium and Playwright. Instead of trying to directly find and manipulate all the elements you want in a web site, with direct references all over your place, you create a model of that page, with objects that represent the elements and even you want.

Instead of this, which breaks if names change:

public class Login {

public void testLogin() { // fill login data on sign-in page driver.findElement(By.name("username")).sendKeys("userName"); driver.findElement(By.name("password")).sendKeys("my supersecret password"); driver.findElement(By.name("sign-in")).click();

// verify h1 tag is "Hello userName" after login driver.findElement(By.tagName("h1")).isDisplayed(); assertThat(driver.findElement(By.tagName("h1")).getText(), is("Hello userName")); } }

You can end up with a test that doesn't have to change, even if the elements do. :

@Test public void testLogin() { SignInPage signInPage = new SignInPage(driver); HomePage homePage = signInPage.loginValidUser("userName", "password"); assertThat(homePage.getMessageText(), is("Hello userName")); }

The SigninPage encapsulates the selectors and actions, so any changes to the page stay within it :

public class SignInPage { protected WebDriver driver;

// private By usernameBy = By.name("username"); // private By passwordBy = By.name("password"); // private By signinBy = By.name("signin");

public SignInPage(WebDriver driver){ this.driver = driver; if (!driver.getTitle().equals("Sign In Page")) { throw new IllegalStateException("This is not Sign In Page," + " current page is: " + driver.getCurrentUrl()); } }

/ Login as valid user @param userName @param password @return HomePage object / public HomePage loginValidUser(String userName, String password) { driver.findElement(usernameBy).sendKeys(userName); driver.findElement(passwordBy).sendKeys(password); driver.findElement(signinBy).click(); return new HomePage(driver); } }

You can extend that to "components". In most web sites similar blocks appear in multiple pages. Once you know that block's parent, the elements are usually accessible by the same relative selectors. You can create a "component" class for such a block, similar to a Page class, initialized with the root's selector.

That said, Playwright can generate tests by recording your actions, has built-in test agents and a CLI that makes driving the browser very easy during AI test generation.

In one of the demo videos, the agent was told to "Find the Garfield movie" in a web site. It opened the site, found out how to search for movies, search for Garfield and open the movie page.

The CLI example shows how an agent can use Playwright to control the browser by sending simple commands instead of manipulating the DOM, eg :

$ playwright-cli open https://demo.playwright.dev/todomvc --headed $ playwright-cli type "Buy groceries" $ playwright-cli press Enter $ playwright-cli type "Water flowers" $ playwright-cli press Enter $ playwright-cli check e21 $ playwright-cli screenshot
June 24, 2026 Score: 1 Rep: 96 Quality: Low Completeness: 30%

If you are exploring options, this comparison of Selenium alternatives covers tools like Playwright, Cypress, BugBug, Katalon, and QAlity in detail: https://qality.dev/blog/best-selenium-alternatives-in-2026-top-testing-tools-to-replace-selenium

June 24, 2026 Score: 1 Rep: 1 Quality: Low Completeness: 20%

I agree that good test design and patterns like Page Objects help reduce flakiness regardless of the framework.

However, Playwright still requires writing and maintaining automation code, page objects, selectors, and framework infrastructure. Platforms like QAlity and BugBug take a different approach by eliminating the need to write automation code altogether. Tests can be created through recording and AI-assisted workflows, while execution, reporting, and maintenance are handled by the platform.

So if you're looking for a modern code-first alternative, Playwright is a great choice. If your goal is to reduce automation maintenance and enable non-technical users to create automated tests, QAlity is worth considering.

June 24, 2026 Score: 1 Rep: 19,744 Quality: Low Completeness: 10%

I've always had bad experiences with the "no code" solutions. The tests they generate were even flakier than badly written Selenium tests. Developers basically ignored test failures in the "no code" solutions because the test was always broken, not the application.

Has that changed?

June 24, 2026 Score: 0 Rep: 26,617 Quality: Medium Completeness: 30%

"If you use IDs for example, a change will break your test. If you used a more generic CSS or XPath selector, it would be less likely to break." This is backwards. If there's an ID, it's infinitely less likely to be changed because it's likely that it's referenced by the web devs. It's the most reliable locator there is.

I think Playwright is a better replacement of Selenium but it still isn't going to write the tests for you. Yes, it will record a test but it's not going to record it in such a way that it's maintainable... page objects, etc. I would record a test and then copy/paste locators and some of the code into page objects. I think it's probably slightly faster than writing the Selenium code from scratch. I think where Playwright beats Selenium is in execution speed and tooling. The execution speed is nearly twice as fast as Selenium code and Selenium doesn't have anything close to parity in tooling. Playwright also has waits built in which are awesome. You can write your own Selenium code to take care of it but you don't need to if it's built in.

June 24, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 10%

That is true, but my point is that Playwright is still similar to Selenium in one way, you still need to write and maintain automation scripts.

I am looking for a tool that anyone can use, even without test automation expertise, that can create test cases automatically and keep them working when the UI changes, with minimal maintenance.

June 24, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 0%

Thanks for sharing this. The blog looks useful. I will go through it and see if any of these tools fit what I'm looking for.

June 24, 2026 Score: 0 Rep: 26,617 Quality: Low Completeness: 10%

I agree. In my experience, many times record and playback systems can't even successfully playback the tests they just recorded.

I have yet to see a single AI platform deliver a fraction of what it has promised.

June 24, 2026 Score: 0 Rep: 26,617 Quality: Low Completeness: 0%

NOTE: This blog is on the QAlity site... so... they are likely written to favor the product they are pushing.