public static < E > void rootDriver ( WebDriver root , E page ) { if ( page == null || root == null ) return ; for ( Class < ? > clazz = page . getClass ( ) ; ! clazz . equals ( Object . class ) ; clazz = clazz . getSuperclass ( ) ) { if ( Enhancer . isEnhanced ( clazz ) ) continue ; Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( Field field : fields ) { setRootDriverField ( root , page , field ) ; } } }
Injects the webdriver into a page .