java - How to handle system.exit in the cucumber test case -


newbie cucumber , selenuim in java

i calling method in cucumber test case , there if goes else part send mail , exit system.when running method cucumber send mail , exit test case. how resolve that

and after using selenium want open browser , check mailbox check mail has sent code or not.

you can use runtime.getruntime().addshutdownhook(hook);

when invoke method, thread hook called whenever vm wants shutdown (including when system.exit() called). can add validation in hook thread.

check java doc more information shutdown hook.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -