Cucumber With Selenium

In previous post we have seen about cucumber introduction and setup with eclipse, now its time to integrate with selenium.

1. Create the feature file to login to AnukoTimesheet
2. Create Step definition class file
3. Runner class
4. Run the script

Note : I assume that you have gone through the basic cucumber and installation post earlier


Step 1 : To create the feature file as LoginTest.feature under src/test/resources




Step4 : Run the cukes file now 

if you are getting error like this, better download latest version of selenium jar and add the class path manually as show in below snapshot. 
      Caused by: java.lang.ClassNotFoundException: com.google.common.base.Optional



To run script follow the below snapshot



5. Report - go to project and target folder to view the reports.




and then report should look like this.



That's it we seen how to write simple feature file. definition file and run the Junit test and view the report.

Thanks


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.