1

Details

My test scenarios currently cover over 300 test cases. Everything is written in Python (3.8) and Selenium and all test cases are covered by exceptions.

At the moment there is only one possibility missing which can be used after X minutes when the current test aborts due to unavailability of the server / site and the next test is executed.

If this one should not work either, then it should best abort the complete test with a corresponding message.

Can I implement this with Selenium?

  • Are using any frame work to run the tests ? – PDHide Apr 1 at 20:31
  • i use unittest with selenium in python – Mornon Apr 1 at 21:02
1

There is a StackOverflow answer to it: https://stackoverflow.com/a/14920854/2252076

In summary:

# You start a function foo
p = multiprocessing.Process(target=foo, name="Foo", args=(10,))
p.start()

# Wait until the function ends or it takes 10 seconds
p.join(10)

# If thread is active
if p.is_alive():
    # Terminate foo
    p.terminate()
    p.join() #Clean-up
| improve this answer | |

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.