@Target(value=TYPE) @Inherited @Retention(value=RUNTIME) public @interface PageHandler
PageCrawler.
To use the page crawling feature, you have to inject the PageCrawler
into your test class and call start-method.
However, you must declare at least one page handler inclusive url mapping.
The following example declares a handler, which article-method is
applicable for all urls containing master-blog.com/article/.
Additionally, the handler method gets an instance of ArticlePage as
parameter:
@PageHandler
@UrlMapping("master-blog.com")
public class BlogPageHandler {
@UrlMapping("/article/")
public void article(ArticlePage articlePage) {
...
}
}
Vani can inject automatically PageObject, FragmentObject,
using WebDriver or current page url, if you want. To do that, you
only have to specify the desired type as parameter of handler method like in
the above example. The current url is always used as the first string
parameter.
Copyright © 2016. All rights reserved.