Engineering Core
ISB Vietnam's skilled software engineers deliver high-quality applications, leveraging their extensive experience in developing financial tools, business management systems, medical technology, and mobile/web platforms.

After more than 1.5 years working in Manual Testing, I realized that for large-scale systems with long-term development cycles, Regression Testing is a major bottleneck. Manually re-executing test cases is not only repetitive and time-consuming but also highly prone to human error. That is when I knew Automation Testing was the inevitable next step.

If you are also starting as a Manual QC like me, don't worry—it is actually a huge advantage. Here is my journey and some tips from when I first started learning Automation with Playwright using Python.

1. What to Prepare Before Starting

Test Case Writing Skills (The Foundation)

This is an essential skill that every QC needs, whether you do manual or automation testing.

  • Proactiveness: If you write your own Test Cases, you will have a better grasp of the requirements (specs). When converting them into scripts, you might discover inconsistencies or gaps in the test cases, allowing you to optimize and update them quickly. If you rely solely on existing Test Cases to write scripts, you might spend too much time trying to understand them. Also, you can't be sure if those Test Cases are still accurate according to the design specs. This makes your scripting process quite passive.
  • Know what to automate: Not everything should be automated. Deep business understanding helps in deciding which cases to automate (high repetition, stable) and which to test manually (frequent UI changes, overly complex logic). This saves a lot of wasted effort.

Basic Knowledge

  • Programming Language: You don't need to be an expert developer. Start with the core concepts: variables, data types, operators, loops, conditional statements (if/else), and functions. Additionally, grasping basic Object-Oriented Programming (OOP) concepts (like Classes and Objects) is highly recommended. Having basic knowledge of a programming language will make the learning curve smoother when approaching a new test scripting language. You can start with Python because its syntax is very close to natural language, making it extremely easy for beginners to learn.
  • Web Knowledge: Explore the HTML/DOM structure and various element attributes to craft effective locators (such as CSS Selectors and XPath). Master the use of browser DevTools (F12) to inspect elements, debug, and monitor Network requests. Additionally, understanding asynchronous mechanisms (Promises, Async/Await) and element states (e.g., visible, enabled) is crucial for leveraging the Auto-wait feature, ensuring that scripts run stably.
  • Version Control (Git): Automation test code is as important as the application's source code. Knowing how to use a Version Control System is a must. You don't need to memorize advanced commands right away. Instead, just get used to basic daily tasks: cloning a repository, creating branches for new test cases, saving your changes (commit), and syncing (pull/push) with platforms like GitHub or GitLab. Knowing these basics will make sure you can manage your script versions safely, track your own changes, and work smoothly with other QCs and Developers without code conflicts.

2. Learning Playwright: Key Concepts

When I started with Playwright, these were the most important things I learned:

Project Setup Commands

Before writing any code, you need to install the Playwright library and the browsers it uses to run the tests. In Python, you just need to type these two simple commands into the terminal:

  • pip install pytest-playwright: This command installs the Playwright framework along with pytest (a very popular testing tool in Python).

  • playwright install: This command downloads the necessary browser engines (like Chromium, Firefox, and WebKit) so Playwright can open them and simulate user actions.

Test Execution Commands 

After writing your test scripts, you need to run them to see if they Pass or Fail. Here are the commands you might use every day:

  • pytest: This command runs all your test files silently in the background (this is called Headless mode - no UI is shown, and it is the default setting).

  • pytest --headed: This command runs the tests and actually opens the browser window for you to see. This is super helpful for beginners, as it lets you watch the bot clicking and typing on the screen with your own eyes.

  • pytest test_login.py: This command only runs one specific test file (for example, the test_login.py file) instead of making the computer run all the files.

Locators (How to find elements)

In the past, QC engineers heavily relied on XPath or CSS Selectors, which can break easily if the DOM structure changes. While Playwright still supports them, it strongly recommends using User-facing Locators—finding elements based on how a user actually perceives them on the screen:

  • get_by_role: Locates elements by their implicit role (e.g., button, input) and display name.

    Python example: page.get_by_role("button", name="Submit").click()

  • get_by_text: Locates elements by the exact text displayed on the screen.

    Python example: page.get_by_text("Forgot password").click()

  • get_by_label: Locates input fields based on their associated Label (for example, an "Email" field).

    Python example: page.get_by_label("Email").fill("test@example.com")

Auto-waiting

This is a "magic" feature. Playwright automatically waits for a button to appear or be ready before clicking it. You don't have to manually write "wait 5 seconds" anymore, which makes your tests much more stable.

Assertions (Checking the results)

To check if a test Passed or Failed, we use expect function.

One of the most powerful features here is auto-retrying assertions. You don't need to write complex code to wait for an element to load. Playwright is smart enough to automatically wait and retry the check until the condition becomes true (or until the timeout is reached).

For example:  

  • Checking if a success message is visible on the screen:

    Python example: expect(page.get_by_text("Login Successful")).to_be_visible() 

  • Checking if an input field contains exactly the expected value:

    Python example: expect(page.get_by_label("Email Address")).to_have_value("test@example.com")

  • Checking if a specific element is disabled (cannot be clicked):

    Python example: expect(page.get_by_role("button", name="Submit")).to_be_disabled()

Read more at: https://playwright.dev/python/docs/test-assertions

3. Automation Support Tools - Work Smarter

Below are the tools that will help you work faster when coding automation test scripts:

  • Codegen: This is a "magical" tool for automatic code generation. You simply interact with the web interface, and Playwright automatically records and converts your actions into source code. It is an excellent way to learn syntax during the early stages.
  • AI Tools (like Cursor): AI is a powerful asset that can speed up code writing based on Test Cases. By crafting a precise prompt in your desired format and providing the Test Case for reference, the AI will quickly generate the test script. Your remaining tasks are to review, run it with Pytest, and refine the logic, saving you the time of coding line by line.
  • UI Mode & Trace Viewer: Don't panic when a script fails. UI Mode and Trace Viewer allow you to replay the "movie" of your test process, inspecting exactly where it failed and seeing the UI state at that moment to find clues for a faster fix.
  • Reports: After running tests, Playwright automatically creates a professional HTML report with full statistics: Passed, Failed, Flaky (intermittent)... and can even include screenshots for each case if configured.

4. Next Steps

Once you master these basics, the next challenge is organizing your code. I highly recommend looking into the Page Object Model (POM)—a design pattern that will make your scripts scalable, readable, and much easier to maintain as your project grows.

Final Thoughts

And that’s everything I’ve learned and prepared while getting started with automation testing.

The journey from Manual to Automation isn’t as scary as I first thought. As long as you have a solid foundation in Manual testing, plus a bit of patience with modern tools like Playwright, you’ll find the work becomes much more exciting and rewarding.

Good luck to you (and to me too!) as we push further on this Automation QC path!

Ready to get started?

Contact IVC for a free consultation and discover how we can help your business grow online.

Contact IVC for a Free Consultation
Written by
Author Avatar
Engineering Core
ISB Vietnam's skilled software engineers deliver high-quality applications, leveraging their extensive experience in developing financial tools, business management systems, medical technology, and mobile/web platforms.

COMPANY PROFILE

Please check out our Company Profile.

Download

COMPANY PORTFOLIO

Explore my work!

Download

ASK ISB Vietnam ABOUT DEVELOPMENT

Let's talk about your project!

Contact US