public boolean setActive ( ) { String baseTabPath = "//*[" + getPathBuilder ( ) . getBasePath ( ) + "]" ; String titlePath = baseTabPath + getTitlePath ( ) ; WebLocator titleElement = new WebLocator ( getPathBuilder ( ) . getContainer ( ) ) . setElPath ( titlePath ) . setInfoMessage ( getPathBuilder ( ) . getText ( ) + " Tab" ) ; LOGGER . info ( "setActive : " + toString ( ) ) ; boolean activated ; try { activated = titleElement . click ( ) ; } catch ( ElementNotVisibleException e ) { LOGGER . error ( "setActive Exception: " + e . getMessage ( ) ) ; activated = setActiveWithExtJS ( ) ; } if ( activated ) { Utils . sleep ( 300 ) ; // need to make sure this tab is rendered } return activated ; }
After the tab is set to active will wait 300ms to make sure tab is rendered