How to make a test fail if driver takes long time to look for an element. I am not sure which elements



  • I am not sure which elements will throw this exception.In general is there any method other than providing - a page load time out , implicit, explicit or frequent wait for a particular element .



  • Depending on the unit test framework which you are using - there are timeout attributes/annotations. E.g.

    • [Timeout] in NUnit
    • @Test(timeout=1000) in JUnit

    In overall it's not a good practice since instead of resolving the root cause of the issue, you'll use the workaround. Your overall test execution time would increase (due to the use of timeouts), while the pass rate would be still low.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2