Bird
Raised Fist0
Testing Fundamentalstesting~15 mins

Skills for modern testers in Testing Fundamentals - Build an Automation Script

Choose your learning style10 modes available
Verify tester skills checklist on skills page
Preconditions (2)
Step 1: Open the Skills page URL
Step 2: Locate the skills checklist section
Step 3: Verify the checklist contains the following skills: 'Critical Thinking', 'Automation Knowledge', 'Communication', 'Domain Understanding', 'Exploratory Testing', 'Continuous Learning'
Step 4: Check that each skill item is visible and enabled
✅ Expected Result: The skills checklist is displayed with all required skills visible and enabled
Automation Requirements - Selenium with Python
Assertions Needed:
Verify page URL is correct
Verify each skill text is present in the checklist
Verify each skill item is visible and enabled
Best Practices:
Use explicit waits to wait for elements
Use Page Object Model for maintainability
Use descriptive locators (e.g., By.ID, By.CSS_SELECTOR)
Use assertions from unittest or pytest
Automated Solution
Testing Fundamentals
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest

class SkillsPage:
    def __init__(self, driver):
        self.driver = driver
        self.skills_section_locator = (By.ID, 'skills-checklist')
        self.skill_items_locator = (By.CSS_SELECTOR, '#skills-checklist li')

    def wait_for_skills_section(self):
        WebDriverWait(self.driver, 10).until(
            EC.visibility_of_element_located(self.skills_section_locator)
        )

    def get_skills_texts(self):
        elements = self.driver.find_elements(*self.skill_items_locator)
        return [el.text.strip() for el in elements]

class TestSkillsForModernTesters(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://example.com/skills')
        self.skills_page = SkillsPage(self.driver)

    def test_skills_checklist(self):
        # Verify URL
        self.assertIn('/skills', self.driver.current_url)

        # Wait for skills section
        self.skills_page.wait_for_skills_section()

        # Expected skills
        expected_skills = [
            'Critical Thinking',
            'Automation Knowledge',
            'Communication',
            'Domain Understanding',
            'Exploratory Testing',
            'Continuous Learning'
        ]

        # Get actual skills
        actual_skills = self.skills_page.get_skills_texts()

        # Verify all expected skills are present
        for skill in expected_skills:
            self.assertIn(skill, actual_skills, f"Skill '{skill}' not found in checklist")

        # Verify each skill item is visible and enabled
        skill_elements = self.driver.find_elements(*self.skills_page.skill_items_locator)
        for el in skill_elements:
            self.assertTrue(el.is_displayed(), f"Skill item '{el.text}' is not visible")
            self.assertTrue(el.is_enabled(), f"Skill item '{el.text}' is not enabled")

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()

This test script uses Selenium with Python and unittest framework.

We define a SkillsPage class to hold locators and methods for the skills checklist section, following the Page Object Model for easy maintenance.

The test test_skills_checklist does these steps:

  • Checks the URL contains '/skills' to confirm correct page.
  • Waits explicitly for the skills checklist section to be visible.
  • Retrieves all skill items text from the checklist.
  • Verifies each expected skill is present in the list.
  • Checks each skill item is visible and enabled on the page.

Explicit waits ensure the page elements are ready before interacting.

Assertions provide clear failure messages if any skill is missing or not visible/enabled.

The setUp and tearDown methods handle browser start and cleanup.

Common Mistakes - 4 Pitfalls
Using time.sleep() instead of explicit waits
Using brittle XPath locators that rely on exact element positions
Not verifying the page URL before checking elements
Not using Page Object Model, putting locators and logic directly in test
Bonus Challenge

Now add data-driven testing with 3 different sets of expected skills lists for different user roles.

Show Hint

Practice

(1/5)
1. Which skill is most important for a modern tester to communicate effectively with developers and stakeholders?
easy
A. Graphic design skills
B. Ability to write complex code
C. Physical endurance
D. Good communication skills

Solution

  1. Step 1: Understand the role of communication in testing

    Testers must explain bugs and test results clearly to developers and stakeholders.
  2. Step 2: Identify the skill that supports this role

    Good communication skills enable clear, effective sharing of information.
  3. Final Answer:

    Good communication skills -> Option D
  4. Quick Check:

    Communication = C [OK]
Hint: Think about talking and writing clearly [OK]
Common Mistakes:
  • Confusing technical coding skills with communication
  • Choosing unrelated skills like graphic design
  • Ignoring the importance of clear explanations
2. Which of the following is the correct way to describe automation testing?
easy
A. Manually checking each feature every time
B. Using scripts to run tests automatically
C. Ignoring test cases to save time
D. Writing test cases only after release

Solution

  1. Step 1: Define automation testing

    Automation testing uses scripts or tools to run tests without manual effort.
  2. Step 2: Match the correct description

    Using scripts to run tests automatically fits this definition.
  3. Final Answer:

    Using scripts to run tests automatically -> Option B
  4. Quick Check:

    Automation = A [OK]
Hint: Automation means using scripts, not manual work [OK]
Common Mistakes:
  • Confusing manual testing with automation
  • Thinking automation means skipping tests
  • Believing tests are written only after release
3. Consider this Python snippet used by a tester to check if a bug is fixed:
def is_bug_fixed(status):
    return status == "fixed"

result = is_bug_fixed("Fixed")
print(result)

What will be the output?
medium
A. True
B. Error
C. False
D. fixed

Solution

  1. Step 1: Analyze the function comparison

    The function checks if status equals the string "fixed" exactly (case-sensitive).
  2. Step 2: Check the input value

    The input is "Fixed" with uppercase F, which does not match "fixed" lowercase.
  3. Final Answer:

    False -> Option C
  4. Quick Check:

    Case-sensitive comparison = False [OK]
Hint: Remember string comparisons are case-sensitive [OK]
Common Mistakes:
  • Ignoring case sensitivity in string comparison
  • Expecting the function to return the input string
  • Assuming no output or error
4. A tester wrote this code to check if a number is positive:
def check_positive(num):
    if num > 0:
        return True
    else
        return False

What is the error in this code?
medium
A. Missing colon after else
B. Wrong comparison operator
C. Function missing return statement
D. Indentation error on if statement

Solution

  1. Step 1: Check syntax of if-else statements

    Python requires a colon (:) after else to mark the block start.
  2. Step 2: Identify the missing colon

    The else line lacks the colon, causing a syntax error.
  3. Final Answer:

    Missing colon after else -> Option A
  4. Quick Check:

    Syntax requires colon after else [OK]
Hint: Look for missing colons after if/else [OK]
Common Mistakes:
  • Thinking comparison operator is wrong
  • Assuming return statements are missing
  • Ignoring syntax errors like missing colons
5. A modern tester wants to improve test coverage by automating tests but also needs to adapt quickly to frequent changes in requirements. Which combination of skills best supports this goal?
hard
A. Automation skills and adaptability
B. Manual testing and strict process adherence
C. Graphic design and communication
D. Physical endurance and documentation

Solution

  1. Step 1: Identify skills needed for automation

    Automation skills help create scripts to run tests faster and more often.
  2. Step 2: Recognize the need for adaptability

    Adaptability allows testers to adjust tests quickly when requirements change.
  3. Final Answer:

    Automation skills and adaptability -> Option A
  4. Quick Check:

    Automation + Adaptability = A [OK]
Hint: Combine automation with flexibility for changing projects [OK]
Common Mistakes:
  • Choosing manual testing only
  • Ignoring adaptability in fast-changing projects
  • Selecting unrelated skills like graphic design
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard