Get Started. It's Free
or sign up with your email address
Flaky test by Mind Map: Flaky test

1. Verifying a fix to flaky test

1.1. Run the attempt for a period of time before validating the fix

1.1.1. Jenkins job that runs every hour

1.1.2. Cmd line trigger

2. What is it

2.1. Definition

2.1.1. A test that doesn't fail everytime

3. Remediation strategies

3.1. Best case

3.1.1. Finding and fixing root

3.2. Life has to move on

3.2.1. Try/catch for locators StaleElementReference If an element is not found first time, try for it again after doing the previous action Especially helpful with gestures

3.2.2. Retry mechanism for failures Make sure retry count is acceptable Also that its not masking a failure

3.3. Worst case

3.3.1. Disable them, the coverage lost is not too high

4. Possible causes

4.1. Test design

4.1.1. Test data Does the test case use the same test data for each run Shared logins

4.1.2. Bad waiting mechanisms Explicit vs implicit waits

4.1.3. Order dependent Tests executed later assume a certain state that is set by earlier tests

4.2. Test synchronization

4.2.1. Application/Backend Add sleeps between each test step Make sure to remove them after diagnosing

4.3. Test execution

4.3.1. Test isolation Running along with other tests vs running in isolation

4.4. Environment

4.4.1. Local vs remote Does this fail locally or only from CI system

4.4.2. Different browsers/devices Mobile Does the error happen on all devices

4.4.3. Build flavor Test vs Dev vs Stg vs Prod Tests that passed in one may not pass in another

4.4.4. Build infrastructure scalability Jenkins Can it handle the peak load of multiple jobs Are other build jobs hogging the system External cloud providers Does the current tier be able to scale

5. Evidence

5.1. Logs

5.1.1. Error messages Is it the same error message every time it fails

5.1.2. Stacktrace Does the error originate from the same line of code

5.2. Screenshots from test runs

5.3. Videos from test runs