Cucumber JVM-Selenium Hooks

30 views
Skip to first unread message

skumar...@gmail.com

unread,
Mar 26, 2019, 5:04:46 PM3/26/19
to Selenium Users

I am using Cucumber JVM with Junit; 
I am using  @BeforeClass and @ AfterClass for setup and tearDown. 

Wanted to user cucumber Hooks to create he context. 

Hooks dont get triggered while using with Junit. 

Please share some sample or suggestions. 

Joe Ward

unread,
Mar 27, 2019, 3:02:35 AM3/27/19
to seleniu...@googlegroups.com
Are you using Cucumber or JUnit hooks?


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0afdde6d-5f77-4659-a746-bf7e9f71a3d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Suresh Kumar

unread,
Mar 27, 2019, 6:23:13 AM3/27/19
to seleniu...@googlegroups.com
I want to use cucumber hooks along with junit annotations. 

Junit for my test runner.

Joe Ward

unread,
Mar 27, 2019, 8:57:56 AM3/27/19
to seleniu...@googlegroups.com
https://zsoltfabok.com/blog/2012/09/cucumber-jvm-hooks/

"Scenario hooks can be defined with the cucumber.annotation.Before and cucumber.annotation.After annotations (JUnit has the exact same annotations in the org.junit package, make sure you use the right ones as cucumber will not process JUnit annotations. Don’t try to use JUnit’s @BeforeClass and @AfterClass annotations either for the same reason – see also section about global hooks):"

Reply all
Reply to author
Forward
0 new messages