Saturday, March 26, 2011

How To Run Multiple Firefox Versions Simultaneously (FF3.x & FF4)

Acquire FF installers here:

1. Install Firefox 4 on C:\Program Files\Mozilla Firefox 4 (upon installation select "custom" to specify the directory when to install FF)

2. Install Firefox 3.x on C:\Program Files\Mozilla Firefox 3 (upon installation select "custom" to specify the directory when to install FF)

3. Create a desktop shortcut for both FF

4. Right-Click on Firefox 4 shortcut then click Properties

5. In the Shortcut Tab add this line to Target field -p PROFILE -no-remote
Example  : "C:\Program Files\Mozilla Firefox 4\firefox.exe" -p PROFILE -no-remote
6. Click OK

7. Double-Click on the Firefox 4 shortcut , then FF profile manager will appear


8. Create a profile for both FF3 and FF4  (see above).
Note: You'll probably only see one profile named "default." All you have to do is create a new profile for Firefox 3, but you may want to rename your existing profile to keep things tidy. I choose "Firefox3" and "Firefox4," ideally use a name with no space in it. Then click Exit

9. Again Right-Click on Firefox 4 shortcut then click Properties.

10. In the Shortcut Tab replace again Target field -p PROFILE -no-remote with -p Firefox4 -no-remote.
Example: "C:\Program Files\Mozilla Firefox 4\firefox.exe" -p Firefox4 -no-remote

11. Do Step 10 to other Firefox 3 shortcut but with -p Firefox3 -no-remote
Example: "C:\Program Files\Mozilla Firefox 3\firefox.exe" -p Firefox3 -no-remote
12. There you go, FF3.x and FF4 browsers in your machine.




Monday, December 13, 2010

10 Fun Things I Can Do with a new Lenovo Laptop

  1. Visit my favorite online networking site (e.g. Facebook, Twitter)
  2. Play the latest online/offline games
  3. Do school work (e.g. assignments and projects)
  4. Create my blog
  5. Chat with friends
  6. Photo editing
  7. Watch my favorite movies
  8. Do productive work at the office
  9. Store and play my favorite music
  10. Take it anywhere I like

This is official entry to the Lenovo-YugaTech Laptop Giveaway

Sunday, December 12, 2010

Installing the guest additions (Ubuntu Guest)

This is how to install guest additions on Oracle VM Virtualbox. The below example will install guest addition to Ubuntu guest OS.
  1. From the VirtualBox menu select Devices > Install Guest Additions a CDROM will appear on your desktop and give you a warning just click Cancel it’s trying to auto-run as if it was in Windows. 
  2. Navigate to Applications > Accessories > Terminal.
  3. Enter the following command to switch to the CDROM directory
  4. cd /media/cdrom
  5. Invoke the installer by running the following command
  6.  
    • if you have a 32bit platform
    sudo ./VBoxLinuxAdditions-x86.run
            or
    • if you have a 64bit platform.
    sudo ./VBoxLinuxAdditions-amd64.run
  7. Once the Guest Additions are installed, reboot and you will be presented with a window telling you the benefits of them. Click Ok to dismiss the window.

screen_capture Sample in Watir

This simple watir script will take a screenshot and save the to a random number filename.

require 'watir'
require 'watir/screen_capture'
include Watir::ScreenCapture
require 'win32ole'

def take_screenshot
  randfname = Array.new(6) { (rand(122-97) + 97).chr }.join
  begin
    directory_name = File.dirname(__FILE__).gsub('/','\\') +
    "\\screenshots\\#{$randdir}"
    if FileTest::directory?(directory_name)
      filename = "#{directory_name}\\#{randfname}.png"
      screen_capture(filename,false, false)
    else
      Dir::mkdir(directory_name)
      filename = "#{directory_name}\\#{randfname}.png"
      screen_capture(filename,false, false)
    end
  end
end

Sample Driver Script for QTP Keyword Driven Framework

The below mentioned framework script is prepared to add three sheets in the runtime data table and retrieve the data from an external excel file. Based on the retrieved data and keywords remaining functions will be executed. Finally the updated runtime results data is exported to external excel file.

Adding sheets to runtime data table

' Adding sheet for Module
DataTable.AddSheet ("Module")
' Adding  sheet for Testcase
DataTable.AddSheet ("Testcase")
' Adding sheet for Teststep
DataTable.AddSheet ("Teststep")

'-- Importing sheets from an external excel file

' Importing data of Module sheet  from external excel file
DataTable.ImportSheet "Path of the excel file",1,"Module"
' Importing data of Testcase sheet  from external excel file
DataTable.ImportSheet "Path of the excel file",2,"Testcase"
' Importing data of Teststep sheet  from external excel file
DataTable.ImportSheet "Path of the excel file",3,"Teststep"
' Getting the total number of rows in the Module sheet
MrowCount=Datatable.GetSheet("Module").GetRowCount
' For loop is started here for Module data
For i=1 to Mrowcount
    ' Setting the first row in the Module sheet
    DataTable.SetCurrentRow(i)
    ' Getting and Assigning the value of current row  to Mflag
    Mflag=DataTable.Value(3,"Module")
    If Mflag ="Y"  Then
        ' If Mflag = Y, assigning the current row value to ModuleId
        ModuleId= DataTable.Value (1,"Module")
        ' Getting the total number of rows in the Testcase sheet
        TcrowCount=DataTable.GetSheet ("Testcase").GetRowCount
        ' For loop is started here for Testcase data
        For j=1 to TcrowCount
            ' Setting the first row in the Testcase sheet
            Datatable.SetCurrentRow (j)
            ' Getting and Assigning the value of current row  to ModuleId1
            ModuleId1=DataTable.Value(4,"Testcase")
            ' Getting and Assigning the value of current row  to Tcflag
            Tcflag=DataTable.Value(3,"Testcase")
            If ModuleId=ModuleId1 and Tcflag="Y" Then
                ' If  ModuleId = ModuleId1 and Tcflag = Y, assigning the
                  current row value to TcId
                TcId=DataTable.Value(1,"Testcase")
                ' Getting the total number of rows in the Teststep sheet
                TsrowCount=DataTable.GetSheet("Teststep").GetRowCount
                ' For loop is started here for Teststep data
                For k= 1 to TsrowCount
                ' Setting the first row in the Teststep sheet
                Datatable.SetCurrentRow(k)
                ' Getting and Assigning the value of current row  to Tcid1
                Tcid1=DataTable.Value(5,"Teststep")
                    If TcId= TcId1 Then
                        ' If TcId = TcId1, assigning the current row value to
                          keyword
                        keyword= DataTable.Value(3,"Teststep")
                        ' Select Case statement is started here
                        Select Case keyword
                        Case "lN"
                        ' If keyword = IN, execute Login function and assign the
                          value to res
                        res=Login()
                        ' Write the value of res to Teststep in the runtime data
                          table
                        DataTable.Value(6,"Teststep")=res
                        Case "CA"
                            ' If keyword = CA, execute Close_Appl function
                            Close_Appl()
                        Case "OP"
                            ' If keyword = OP, execute OpenOrd function and 
                              assign the value to res
                            res=OpenOrd()
                            ' Write the value of res to Teststep in the runtime
                              data table
                            DataTable.Value(6,"Teststep")=res
                        ' End of Select Case statement
                        End Select
                    ' End of If statement for Test Step sheet
                    End If 
                ' End of For loop for Teststep data
                Next
            ' End of If statement for Testcase sheet
            End If 
        ' End of For loop for Testcase data
        Next
    ' End of If statement for Module sheet
    End If
' End of For loop for Module data
Next

'--- Exporting results
 
' Exporting the runtime data sheet of Teststep to external excel file
Datatable.ExportSheet "Path of the file where you want","Teststep"

' Need to define functions like Login, Close_app and Openord

'---  Login function

' function definition for Login
Function Login()
----
End Function

'--- Close application function

' function definition for Close_Appl
Function Close_Appl()
-----
End Function

'--- Openord function

' function definition for OpenOrd
Function OpenOrd()
----
End Function

Tuesday, December 7, 2010

Diaspora targeting Facebook

Recently, I sent a request to access this Facebook-like social networking application. A diaspora (from Greek διασπορά, "scattering, dispersion"[1]) which clearly define its type. This free software personal webserver is a distributed social networking service that aims to decentralize social networking services like Facebook. The project is currently under development by Dan Grippi, Maxwell Salzberg, Raphael Sofaer, and Ilya Zhitomirskiy student from New York University's Courant Institute of Mathematical Sciences. To send a request to view this exciting application click here

What is Diaspora?

Diaspora is the social network that puts you in control of your information. You decide what you’d like to share, and with whom. You retain full ownership of all your information, including friend lists, messages, photos, and profile details.

Share what you want, with who you want.

[via joindiaspora]

Monday, November 1, 2010

Installing RPM Files Using Alien

  1. Install Alien first
  2. $sudo apt-get update $sudo apt-get install alien
  3. This will convert the .rpm to a .deb.
  4. $sudo alien -k name-of-rpm-file.rpm
  5. Execute .deb package to install
  6. $sudo dpkg -i name-of-deb-file.deb