0
0
Selenium Pythontesting~10 mins

Markers for categorization in Selenium Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to mark a test with the 'smoke' marker.

Selenium Python
@pytest.mark.[1]
def test_example():
    assert True
Drag options to blanks, or click blank then click option'
Askip
Bslow
Cregression
Dsmoke
Attempts:
3 left
💡 Hint
Common Mistakes
Using a marker name that does not exist or is misspelled.
Forgetting the '@pytest.mark.' prefix.
2fill in blank
medium

Complete the code to skip a test using the 'skip' marker.

Selenium Python
@pytest.mark.[1](reason="Not ready")
def test_feature():
    assert False
Drag options to blanks, or click blank then click option'
Aslow
Bskip
Csmoke
Dregression
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'skipif' instead of 'skip' without condition.
Not providing a reason for skipping.
3fill in blank
hard

Fix the error in the marker usage to mark a test as 'regression'.

Selenium Python
@pytest.mark[1]
def test_bug_fix():
    assert True
Drag options to blanks, or click blank then click option'
A.regression
B(regression)
C('regression')
D.regression()
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses which cause syntax errors.
Using string arguments instead of attribute access.
4fill in blank
hard

Fill both blanks to mark a test as 'slow' and skip it with a reason.

Selenium Python
@pytest.mark.[1]
@pytest.mark.[2](reason="Too slow")
def test_heavy():
    assert True
Drag options to blanks, or click blank then click option'
Aslow
Bskip
Csmoke
Dregression
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up marker names or using wrong syntax.
Forgetting the reason argument in skip.
5fill in blank
hard

Fill all three blanks to mark a test as 'regression', skip it with a reason, and add a custom marker 'api'.

Selenium Python
@pytest.mark.[1]
@pytest.mark.[2](reason="Flaky test")
@pytest.mark.[3]
def test_api_call():
    assert True
Drag options to blanks, or click blank then click option'
Aregression
Bskip
Capi
Dslow
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses for markers that don't require them.
Forgetting to add the reason for skip.