1 / 17

Tutorial on the integration of Selenium with cucumber for experts and fresher’s

Before starting the work with selenium or cucumber we know that what is actually selenium and cucumber. Here in this PPT, I will share the Best tutorial about Selenium and cucumber. For more information please visit here.

Download Presentation

Tutorial on the integration of Selenium with cucumber for experts and fresher’s

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Original Source: Tutorial on Selenium, Cucumber and Gherkin

  2. What is SELENIUM In recent times, there are a lot of applications which are web-based and which run in a browser. Testing such applications manually take up much time hence automated testing tools like selenium is the way to go. Selenium is a free open source automated testing tool for web applications across various browsers and platforms. It is actually similar to HP Quick Test Pro only that Selenium converges on automating web-based applications.

  3. What is Many times it happens that clients are non-technical persons and to make them understand the testing process you need a behavior driven framework. Cucumber is a behavior driven framework which can help you to produce the product as per client needs. It tests the behavior of the application and writes the tests in simple English language which is similar to English and known as Gherkin language.

  4. Prerequisite for using Cucumber with Selenium • Selenium jar files: • Selenium-server-standalone • Can be downloaded at • http://www.seleniumhq.org/download/

  5. Continue… • Jar files For Cucumber : • Cucumber-core • Cucumber-html • coberturacode coverage • Cucumber-java • Cucumber-junit • Cucumber-jvm-deps • Cucumber-reporting • Hemcrest-core • Gherkin • Junit • Can be downloaded at http://mvnrepository.com/search?q=Cucumber • On this page, you have to search files & download them individually. Let’s go through Some Screenshot!

  6. Continue…

  7. Continue…

  8. Continue…

  9. Automation Testing Using Cucumber with Selenium • First of all, create a JAVA project in eclipse by New -> Project -> Other, here you have to select Maven in other projects

  10. Continue… • Now go to Project > Select Properties > Java Build Path and add all the libraries downloaded earlier

  11. Continue… • Now create a folder by name "Features" and then create a new file in it by name MyTest.feature. • You can write Gherkin syntax in it now.

  12. Continue… • Write below lines in MyTest.feature file using Gherkin syntax. Feature: Reset functionality on login page of Application Scenario: Verification of Reset button Given Open the Firefox and launch the application When Enter the Username and Password Then Reset the credential

  13. Continue… • Now write the selenium testrunnerscript. Here we create 'TestRunner' package and then 'Runner.java' class file under it. • @RunWith() is the test runner class to start executing test • @CucmberOptions() is used to set some properties for cucumber test like feature file, step definition, etc.

  14. Continue… Now here we create 'StepDefinition' package and then 'Steps.java' script file under it. @Given is used to open Firefox and launch the application @When is used to enter the username and password @Then  is used to reset the credential

  15. Continue… Now execute the script and analyze the output.

  16. Conclusion • Cucumber is a recognized BDD tool and it is very simple to write/read and can be read by clients either they are a technical and non-technical person. • Cucumber and Selenium integration can be done using the following 3 steps: • Create a feature file and write tests in Gherkin language. • Then Create Testrunner file and execute this script. • Create Step definition, the real selenium script described under this package. • Original Source: • Tutorial on Selenium, Cucumber and Gherkin • Selenium with Cucumber (BDD Framework): Tutorial with Example

  17. Contact Us Web www.nexsoftsys.com Call +1-646-971-0799 Email info@nexsoftsys.com

More Related