Sunday, July 22, 2012

Recovery scenario example using on error resume next

x=0

y=1
On error resume next


z=y/x
msgbox z

If err.number <>0 Then
Err.clear
Reporter.ReportEvent micFail,"Test Fail at the line " & err.number ,"Failed due to "& err.description


End If

Friday, July 20, 2012

Get Internet Explorer Version


Const HKEY_LOCAL_MACHINE = &H80000002


strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _    strComputer & "\root\default:StdRegProv") 
strKeyPath = "SOFTWARE\Microsoft\Internet Explorer"


strValueName = "Version"oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValuemsgbox  "Installed IE Version: " & strValue
msgbox "Major IE Version: " & Left(strValue,1)

Tuesday, July 17, 2012

Recent interview questions one of my friend shared with me


1)      Give examples of Client serve models
Client server application is 2 tier architecture where UI+BL is on client system and Database is on server
Ex : any windows based applications developed using java, vb and backend as SQL server, Oracle…etc
   Ex: eSeva application used in the eSeva Office, Ticket reservation system…. ( not online reservation)
2)      what is test Strategy?
This document specifies the approach to be followed in developing the project which includes details like   Approach, Estimations, Configuration management, Reporting process, Resource….etc
3)      what bug tracking tool or defect management tool you used in your company
you have to give the answer as tool what you have used like QC , Bugzilla, jira…etc
4)      Difference between Smoke and Sanity testing
Both are same
5)      Difference between Thick Client Application Testing / Thin Client Application Testing.
Thick Client is 2-tier archictecture where UI+BL is on the client system and DB on the server
Thin Client is 3 tier architecture where UI is on Client and BL is on middle server and DB is on DB server

6)      Difference between Test Design Techniques & Defect Prevention Techniques.
Defect design techniques are Decision table, cause effective graph, BVA, ECP..etc and
Defect prevention techniques are related to process to be followed like reviews, testing at each level to prevent the defects
7)      Differences between Testing Methodology / Testing Process / Test Strategy / Test Schedules / Test Factors/test log

10)  what is the framework we are using in QTP
Give the answer which framework you have used like keyword, datadriven, moduler….etc
11)   if you have given Object repository and Descriptive programming which one will prefer?why
It depends on project like will the objects will be frequently changing/ managing objects is difficult means    go for Descriptive else with OR…… its not just like that we decide based on our satisfaction it should be decided by the project situation
12)  How do you make your test cases connected to qtp
 There is no opition to map testcases to QTP (question is not clear)
13)  write syntax for delete in sql2005
Delete from emp where empid=”e005”
14)  what is scalability testing?
Same Load Testing

15)  Test objects are related to
               Sequence model
              State chart model
             Transition model 
     Check the UML Diagrams 

A webtable is having 100*500 cells; and one of the cell is having abcde search for the string

For i=1 to 100
        For j=1 to 500
                        s=Browser("B1").page("p1").Webtable("t1").GetCellData(i,j)
                        If s="abcde" Then
                                found=1
                                print "abcde  is found in cell    :"&i&","&j
                                Exit for
                        End If
    Next
        If found=1 Then
                        Exit for
        End If
Next

Sample script to handle the web page with window object

DIM wIEWinObjectSet 

wIEWinObject = Window("regexpwndtitle:= .*Windows Internet Explorer.*|.*Microsoft Internet Explorer.*","regexpwndclass:=IEFrame","isowned window:=False","is child window:=False").WinObject("regexpwndclass:=Internet Explorer_Server")


wIEWinObject.Type "apple"


rc = Browser("iGoogle").Page("iGoogle").WebTable("html tag:=TABLE","class:=gssb_e").GetROProperty("text")

msgbox rc