public By getWebDriverBy ( ) { switch ( how ) { case name : return By . name ( this . value ) ; case xpath : // Work around HLWK driver bug return By . xpath ( this . value . replaceAll ( "/BODY\\[1\\]/" , "/BODY/" ) ) ; case id : return By . id ( this . value ) ; case tag : return By . tagName ( this . value ) ; case text : return By . linkText ( this . value ) ; case partialText : return By . partialLinkText ( this . value ) ; default : return null ; } }
Convert a Identification to a By used in WebDriver Drivers .