V
V
Valery Glukhovtsev2018-08-10 07:03:07
Java
Valery Glukhovtsev, 2018-08-10 07:03:07

How to implement the ability to stop a JUnit-Selenium test while it is running?

Imagine the most common test written in java, Junit + Selenium. When passing this test, it is necessary to implement the possibility of stopping its execution (for example, by pressing a button), while the driver should not be closed, and continuing the execution (for example, by pressing the same button).
Are there any ideas how to do this?
The only thing that comes to my mind is the idea to raise a second thread that will listen to a button press. But how do you stop the test?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2018-12-15
kuzmin @sergueik

5c155ecc2c545010847262.pngEMNIP Selenium will forcibly close the browser fairly quickly by timeout. and in order to follow the button, it is enough to turn the test into a (secretly) graphical application - the choice of the hall - SWT or Swing or JavaFx - it will be no different from the console one except for a bunch of additional dependencies - do you have an example? i have both SWT and JAvaFx apps and Selenium tests in my git repo - it's usually rare for anyone to cross a hedgehog with a snake...
this will stop the test not at an arbitrary point, but where it will
(new CustomDialog(shell)).open();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question