0

I created page object model framework using Selenium Web Driver,TestNG and ANT.

Problem: Single Test case is executed successfully but while executing them together some test cases fail.

Reason:

  1. Network issue.
  2. Browser is not able render DOM quickly which creates StaleElementException, NoSuchElementExeception etc.
  3. Server is taking time to respond to request

Work Around: In my framework I am re-running failed test cases automatically.

  • 2
    What is your question? It's not clear from your writing, you might want to reword it. – Chris Kenst May 24 '15 at 15:54
  • Do you mean your tests are failing when run all together? In a sequence or concurrently? Does any test depends on the results of another? – dzieciou May 24 '15 at 17:19
  • What is network issue? – dzieciou May 24 '15 at 17:21
  • Second reason: did you try to increase timeout? Wait for certain elements to load, before starting a test? – dzieciou May 24 '15 at 17:22
  • 1
    Finally, this workaround has some flaws: if the test if failing because of intermittent bug in the system, then by re-runing the test until it pass you may ignore this bug. How do you know when the test is failing because of the bug in the test or in the system? – dzieciou May 24 '15 at 17:25
1

You need to troubleshoot / evaluate below options

  1. Is your test machine having low configuration or in a different network ?
  2. If you run tests on machine which has Application installed is it faster ?
  3. Can you batch it and run tests ? instead of running it altogether ?
  4. Can you distribute the cases. Compile the the project as a jar. Deploy it in multiple machines. Run selected set of cases from each executable ? This way you have multiple test machines sharing the load
  5. Re-running failed test is good option, You many need to isolate / trouble shoot those failed tests. Can you split those cases (long running cases further)
  6. I have personally observed timeout issues when machines are in different domain. I have tried to map network drives locally, install app on the test machine, increase configuration of test machines

This mostly looks to be infrastructure issue, network issue. Alternatively you can try distributing cases across multiple machines. Instead of running 700 cases I would try building up in 10, 20, 50, 100 and start distributing them across multiple nodes.

  • What's low configuration? – dzieciou May 25 '15 at 17:14
  • 1
    your machine has 2GB RAM, Single Proc machine or 100% CPU usage before starting the run. These situations would lead to resource contention, slowing execution. – Siva May 26 '15 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.