@Then("^the first (\\d+) blocks from article is shown$") public void the_first_blocks_from_article_is_shown(int stories) throws Throwable { List<WebElement> s = webDriver.findElements(By.cssSelector(".story-latest .article-body .sample-paras p")); assertEquals(s.size(), stories); }