code: @Override
      public void type(String text) throws WidgetException{
          try{
  	    	if (getGUIDriver().isJavascriptTypeMode()) {
  
                  // Replaces apostrophes that have not been escaped with escaped variations
                  // Slashes need to be escaped multiple times.  Once for Java's string escaping
                  // and again for the RegEx engine escaping.
  	            final String theText = text.replaceAll("(\\\\')|(\\')", "\\\\'");
                  highlight( HIGHLIGHT_MODES.PUT);
                  try {
                      eval("arguments[0].value='" + theText + "';");
                  } catch (WidgetException we) {
                      throw new RuntimeException(we);
                  }
  	            try {
  					Thread.sleep(500);
  				} catch (InterruptedException e) {
  				}
  	        } else {
  	            // TODO Test this.
  	            synchronized (InteractiveElement.class) {
  	                getGUIDriver().focus();
  	                click();
  	                WebElement webElement = getWebElement();
  	                highlight( HIGHLIGHT_MODES.PUT);
  	                webElement.clear();
  	                webElement.sendKeys(text);
  	            }
  	        }
          }catch(Exception e){
          	throw new WidgetException("Error while trying to type at " + getByLocator(), getByLocator(), e);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see qc.automation.framework.widget.IInteractiveElement#type(java.lang.String,
  java.lang.String)