Monday Sep 14, 2009

How to Test External Sites (Internet Sites) using Selenium

[Article by]

    Problem :

    If your testing site (ex: / is behind the proxy then selenium fails to access the site. 

    Because selenium itself acts as proxy to AUT (Application Under Test) and which fails to resolve internet sites behind proxy. site says using proxy options, while starting the server will help to resolve the external sites.

    i.e java -jar selenium-server.jar -Dhttp.proxyHost=<proxyHostName> -Dhttp.proxyPort=<proxyPort>

    But the above solution doesn't resolve the issue.

    Before jumping in to solution let us see how selenium server invokes browser and access the internal/external sites.

    When we invoke NewBrowserSession Request to selenium server (i.e selenium.start()) the following background steps are performed.

    For \*firefox/\*chrome:

    1)Extract the CustFirefoxProfile bundled with selenium server.

    2)This will make sure clean firefox session for every new browser session.

    3)Command line jvm proxy settings does not affect to the new firefox session.

    For \*iexplore:

    In case of Internet Explorer , it will simply create custom profile from the current IE instance settings.

    So, for IE simply set the browser proxy to access the internet sites and running tests on internet sites will work. We need solution only for firefox/chrome browser sessions. 


Solution :

    1) Extract the selenium-server.jar using WinRAR/7zip/Winzip archive tool.

    2) Copy "customProfileDirCUSTFF" to a new folder as "MyProxyFirefox"

    3) Under "MyProxyFirefox" folder create firefox user settings file.

       (i.e create a New Text File with Name "prefs.js" with out quotes. Extension of File Should be .js)

    4) Now copy the following properties to prefs.js file.

       user_pref("network.proxy.type", 1);

       user_pref("network.proxy.ftp", "");

user_pref("network.proxy.ftp_port", 8080);

user_pref("network.proxy.gopher", "");

user_pref("network.proxy.gopher_port", 8080);

user_pref("network.proxy.http", "");

user_pref("network.proxy.http_port", 8080);

user_pref("network.proxy.share_proxy_settings", true);

user_pref("network.proxy.socks", "");

user_pref("network.proxy.socks_port", 8080);

user_pref("network.proxy.ssl", "");

user_pref("network.proxy.ssl_port", 8080);

user_pref("network.proxy.no_proxies_on", "localhost,,");

   5) Now replace "" with your Web Proxy and also replace "8080" port with the webproxy port.

   6) For By Pass the Proxy for Internal Sites then update last property value with comma as separator.

      i.e network.proxy.no_proxies_on

   7) Now start the Selenium server with the following options.

   i.e java -jar selenium-server.jar -firefoxProfileTemplate MyProxyFirefox


Saturday Apr 21, 2007

Oracle RAC - Errors and Issues

 I try to summarize here some of the errors and its solutions i got while running a Oracle 10g R2 Real Application Cluster (RAC) Install on VMware Linux install.


starting VIP application resource on (2) nodes1:CRS-1006: No more members to consider
CRS-0215: Could not start resours ''
  : Check the log file /u01/app/oracle/product/10.2.0/crs/log/vm01rhel/racg/
- I got this issue resolved by specifying the default gateway to some dummy ip address (same subnet) in both of my virtual machines. Earlier i didnt specify any default gateway both in my virtual machines and got this error


Oracle Notification Server Configuration Assistant (Clusterware) - FAIL

I got some ocfs2 issues due to the wrong rpm i selected
First do uname -a and then see which OS you have got ,rpm's which supports the same version needs to be downloaded from


While installing Oracle Clusterware and database i got an error "Remote 'AttachHome' failed on nodes:"
After installation run this command as a Oracle user and attach home will be successfull
/u01/app/oracle/product/10.2.0/db_1/oui/bin/runInstaller -attachHome -noClusterEnabled ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 ORACLE_HOME_NAME=OraDb10g_home1
CLUSTER_NODES=vm01rhel,vm02rhel "INVENTORY_LOCATION=/u01/app/oracle/oraInventory" LOCAL_NODE=vm01rhel(or vm02rhel)
Note : In case you are running this command after a clusterware installation , replace 'db_1' with 'crs'


How do i Remove Oracle Database and Clusterware thru command line (incase the oui doesnt uninstall it)
/u01/app/oracle/product/10.2.0/db_1/oui/bin/runInstaller -removeHome -noClusterEnabled ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 ORACLE_HOME_NAME=OraDb10g_home1 CLUSTER_NODES=vm01rhel,vm02rhel "INVENTORY_LOCATION=/u01/app/oracle/oraInventory" LOCAL_NODE=vm01rhel(or vm02rhel)
-where vm01rhel / vm02rhel are your node names
-OraDb10g_home1 is the Oracle DB Home name

Note : In case you are running this command after a clusterware installation , replace 'db_1' with 'crs'


Running fails (after installing clusterware and database) OR ocrconfig error
Disk volume needs to be mounted as "datavolume" -> mount -t ocfs -o datavolume /dev/sdc1 /u02/../ocfs)
Edit /etc/fstab and add this line to mount the disks (sdc1, sdd1 etc) permanantly mountable
/dev/sdc1 /ocfs ocfs _netdev,datavolume 0 0
/dev/sdd1 /ocfs ocfs _netdev,datavolume 0 0


INITPROT : Failed to start cluster
-> unmount the shared disk/partition (sdc1, sdd1 etc)
-> o2cb offline/unload/ load/start/ cluster
-> now run again (sometimes you may need to delete the /etc/oracle directory to re run this command successfully)


Oracle Server Notifcation Failed


After Restarting of RAC Database instance machines, the DB admin console(http://:1158/em) is not accessible: After Restarting the nodes, Login as Oracle user
- Now start the emctl (Enterprise Manager) dbconsole . This will start the dbconsole. Now you can access the console and do the db operations by accessing http://:1158/em
$emctl start


Cannot shutdown the Database instance from DBconsole:  Do this for all the nodes. Now try to shutdown the Db instance
- $srvctl stop nodeapps


I'm a Quality Engineer at Sun Microsystems. Here in this blog, you may find information about Software Testing, Portal Server, Virtualization, Web2.0 and Misc Technical topics. The views expressed here are personal and does not reflect that of my employer


« February 2015