BDD with PageObject

Create child page - search result page

And "search_result.rb":

touch search_result.rb

alt text

We need to copy following content to "search_result.rb" and delete them from "base_page.rb".

class SearchResult < Page

def openTheFirstItemInSearchResult
    clickElementBy("xpath", "//div[@id=\"result_0\"]//span[@class=\"lrg bold\"]")
end

end

alt text

alt text