Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Automated Testing - Running Suite fails even though tests pass

mrobins100
Tera Contributor

When I run a Suite of ATF tests, some of them fail even though the tests pass when run individually?

 

Is there a common reason for this, or any caveats I should know when building suites of tests?

2 REPLIES 2

Sreeram Nair
Tera Guru

When Automated Test Framework (ATF) tests pass individually but fail when run as a suite, it usually means the tests are not fully isolated or have timing conflicts.

Idea way would be for each ATF test to be completely self-contained, creating and cleaning up its own data without depending on records from other tests, since most data is rolled back between tests. Some tables are excluded from rollback, which can lead to data collisions.

Tests can also interfere with each other if they share the same user session or run in parallel, so it’s best to impersonate a user at the start of every test.

Timing issues are another common cause, when UI steps run before background processes or workflows finish. So, adding a “Run Server-side Script” or short wait step helps synchronize actions.

 

You should also ensure every test targets uniquely named data to prevent cross-test conflicts. If the suite is configured for parallel execution, disabling it temporarily can help confirm whether concurrency is the issue. In general, make sure tests are small, deterministic, and independent to ensure consistent suite runs.


ɪꜰ ᴍʏ ᴀɴꜱᴡᴇʀ ʜᴀꜱ ʜᴇʟᴘᴇᴅ ᴡɪᴛʜ ʏᴏᴜʀ Qᴜᴇꜱᴛɪᴏɴ, ᴘʟᴇᴀꜱᴇ ᴍᴀʀᴋ ᴍʏ ᴀɴꜱᴡᴇʀ ᴀꜱ ᴛʜᴇ ᴀᴄᴄᴇᴘᴛᴇᴅ ꜱᴏʟᴜᴛɪᴏɴ ᴀɴᴅ ɢɪᴠᴇ ᴀ ᴛʜᴜᴍʙꜱ ᴜᴘ.




ʙᴇꜱᴛ ʀᴇɢᴀʀᴅꜱ


ꜱʀᴇᴇʀᴀᴍ

Shaqeel
Mega Sage
Mega Sage

Hi @mrobins100 

 

What is the failure reason?

If poosible share screenshots.

Is it due to exceed timeout?

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel