Skip to main content

Posts

Showing posts with the label Selenium Tips

Selenium Rare Tips - Part II

1. Get Browser Name, Version and Environment Details Java Script Expressions which you can use by Selenium.getEval to get the values. navigator. appCodeName     //For Browser Name navigator. appVersion      //For Browser Version navigator. userAgent       //For both details navigator. appName         //For Browser Name navigator. cookieEnabled   //Cookie enabled or not navigator. platform        //OS 2. Get Current URL selenium.getLocation ( ) 3. Scroll Bar Position Actual Width/Height of element: ( Excluding ScrollBar ) selenium.browserbot.getCurrentWindow ( ) .document.getElementByid ( 'css#id' ) .clientWidth selenium.browserbot.getCurrentWindow ( ) .document.getElementByid ( 'css#id' ) .clientHeight Max Scroll Position: scrollWidth - clientWidth    //Max Horizontal Scroll Position scrollHeight - clientHeight  //Max Vert...

Selenium Rare Tips - Part I

Hi all, Here I am going to list out some rare and useful tips for selenium users. 1. Start/Shutdown SeleniumServer in proper way public   static   void  startSeleniumServer ( )   throws   Exception   {           try   {          ServerSocket  serverSocket  =   new   ServerSocket ( RemoteControlConfiguration. DEFAULT_PORT ) ;         serverSocket. close ( ) ;                          //Server not up, start it                  try   {                          RemoteControlConfiguration rcc  =   new  RemoteControlConfiguration ( ) ;                          rcc. setPort ( Remo...