How to integrate Selenium Webdriver with Cucumber -
i looking integrate selenium webdriver cucumber. please let me know if has implemented same.
you need cucumber-jvm. after when write feature files need define steps definitions using selenium (this pom based project or direct api call).
below links on how go implementing this
links http://cukes.info/install-cucumber-jvm.html
http://cukes.info/running.html
snippets
feature sample
feature: page verification scenario: verify page given user navigated page , user signup user should redirected login when user click "https://page.com/userlogin/" user should verify "login" , close browsers
steps definition
public class stepsdefinitions { webdriver driver = null; @given("^user navigated \"([^\"]*)\"$") public void gotosite(string link) throws throwable { driver = new firefoxdriver(); driver.navigate().to(link); } @when("^user click \"([^\"]*)\"$") public void clicksignup(string link) throws throwable { driver.findelement(by.linktext(link)).click(); } @then("^user should verify \"([^\"]*)\"$") public void user_should_verify(string title) { assert.asserttrue( driver.gettitle().equals(title)); } @and("^close browsers$") public void close_browsers() throws throwable { driver.close(); }
Comments
Post a Comment