We have selenium scripts (say around 20 scripts). When we run all the 20 scripts some how 3 or 4 scripts going to fail but when I run the same script it is going to pass. I don't understand whether I am doing something wrong or if there is any different approach to run multiple scripts. Please help me
closed as unclear what you're asking by IAmMilinPatel, ECiurleo, testerab Feb 4 '16 at 0:54
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
We have a bunch of selenium test cases and could observe a similar behavior. We dug into the issues and figured out two things:
- Make test cases "orthogonal"
Test cases should not depend on each other. But that also means that every test case is responsible for creating the correct precondition for itself to run. Don't make any assumptions about the environment, e.g. always create fresh empty database tables before running a test case.
- AJAX is a bit trickier to test
For more specific advice some samples of you testcode is needed.