Tuesday, July 31, 2012

Write a program to insert 100 values and to delete 50 values from an array




ReDim oArray(100)
For iCounter=0 to ubound(oArray) 
           oArray(iCounter)=iCounter   
         'Print total 100 Values             
print(oArray(iCounter))
Next
print "******************************"
print "******************************"
ReDim preserve oArray(50)
For iCounter=0 to ubound(oArray) 
   'Print Values after deleting 50 values  
          print(oArray(iCounter))
Next

Sort Array elements


Dim oArray
Dim oCounter1
Dim oCounter2
Dim tmp

oArray=array(8,3,4,2,7,1,6,9,5,0)
For oCounter1=lbound(oArray) to ubound(oArray)
        For oCounter2=lbound(oArray) to ubound(oArray)-1
                    If oArray(oCounter2)>oArray(oCounter2+1) Then
                        tmp=oArray(oCounter2)
                      oArray(oCounter2)=oArray(oCounter2+1)
                        oArray(oCounter2+1)=tmp
                    End If       
    Next  
Next

For oCounter1=lbound(oArray) to ubound(oArray)
    oTemp = oTemp & oArray(oCounter1)
Next
msgbox oTemp

Sunday, July 22, 2012

VBScript to find the number of times a particular character is repeated in a given string.


Dim Str
Dim SearchStr
Dim Cnt 
Dim Str1
Cnt =0


Str=Inputbox("Enter any sentense only alphabets")
SearchStr = Inputbox("Enter Search String") 
For i=1 to len(Str)
        Str1=mid(Str,i,1)
if trim(ucase(Str1))= trim(ucase(SearchStr)) Then
Cnt=Cnt+1
End if
Next
msgbox "The given character found : "& Cnt & " : Times"

Step by step display the table for a given number.


Dim a,b,c
a=InputBox("Enter the number whose table is required!")
for i= 1 to 10
b=a*i
c=c&a&"*"&i&"="&b&vbcrlf
MsgBox c
Next

Count the selected sheet and Display the cell text by using for loop


ParamTotal = DataTable.GetSheet("Global").GetParameterCount


For i = 1 To ParamTotal
   value = DataTable.GetSheet("Global").GetParameter(i).Name
   msgbox value
Next

Using WebTable Count Display the Web Check Boxes


Set CheckBox=Browser("Browser").Page("Page").WebTable("WebTable").ChildItem(2,1,"WebCheckBox");


'2-"Select Row Using Id"
'1-"Select Column using Id


Msgbox CheckBox.Count

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


Interview Question Company -1


1. What is test plan?
2. Testing Levels?
3. How to get max salary from the employee table?
4. How to read data from excel(Multiple times) and login into the application using credentials?
5. 9 balloon are there but weight only 3 times and get the minimum weight of the balloon?
6. when you login with the specific credentials for the first time it was able to login but when you login with same credential you are unable to login then how you validate those situation?
7. How to get the employee names which is starts from "C" name/letter

Thursday, July 12, 2012

Company-2 Interview Questions

1.What is framework?
2.How to get middle number of the given string?
3.How to compare excel and webtable data?
4.Write a code for convert a string horizontal to vertical?
5.How to execute lo gin script for number of times?
6.What is register user function?
7.File System Object?
8.Write program for creating excel?
9.What are the differ ace tabs in QC?
10.How to update excel with out opening,1,2,8?
11.How to get row count from the excel and global sheet?
12.What are the utility functions available ?
13.String functions in VB Script?
14.Syntax of Instr ?
15.How to retrieve links from inside cell which is in the Web table?
16.How to concatenation two strings?
17.What is Reported.Report event?
18.What is systemutil.Run and Syntax?
19.What is Run,NotRun,Fail in the QC?
20.What is child item and child object?
21.difference bw Sync,Wait, and Wait Property?
22.What is Virtual Object?
23.Action Syntax?
24.How to addsheet
25.Types of object Rep and explain both
26.Write a program to find the given "Guru Prasadu", 2nd U position and 3 rd "U" Position
27.How to Load OR file at Runtime

Company-3 Interview Questions


1.What is sytem testing,functional testing
2.if i have 100 test cases in that 25 fail.how many tc will do regression and how many will do retesting.
3.count of web edit and get child radio buttons..
4.write script for login and it should returns either true or false
5.same login function should iterate the multiple times with differences test data
6.how to call keywords in keyword driven frame work
7.how to review testcase with out application
8.seviority and priority
9.write a script for read the files for folder
10.i have 10 line of code i want to skip error upto 5 lines from 6 Th line if any error popup is there it should display?

IP Interview Questions


1 .What is the framework .
2. How to retrieve the value from  one action to another action
3. How to use Dictionary object
4. How to make case sensitive and insensitive dictionary.
5. What is Compare Mode
5. What is the system testing, Functional System and Non Function
6. What is the STLC ?
7. How to Return Object, 
8. Difference b/w Call by Value, Call By Reference
9.How to identify the Object
10. How to select Radio Group Using Child object
11. How to Create Class in VBScript
12. What is Class?
13.What is Option Explicit
14.How many records mode and Run modes has qtp?
15.How to get column count from excel sheet
16.How to close 5 browser
17.How to add recovery scenario to selected step,
18.How to add requirements in QC

How to Display the vertical string to horizontal


 Str = "Guru Prasad"
    For i =len(Str)  to 1 step-1
      Le = mid(Str,i,1)
      oTemp = Le & vbNewLine & oTemp
    Next
msgbox oTemp



How to get count of repeated word in given string Ex : "guru prasad"



str = "guruprasuadu"
Cnt =0
p=1
do while instr(p,str,"u") > 0
          Cnt = Cnt +1
p = instr(p,str,"u")+len("u")
msgbox p
loop
msgbox Cnt

How to open multiple&new tab browsers at run time



 Systemutil.Run "iexplore.exe","www.google.com"
 wait(2)
 Set oDesc = Description.Create
 oDesc("Micclass").Value = "Browser"
 Set oBrowser = Desktop.ChildObjects(oDesc)
 strBrowserName = oBrowser(0).GetROProperty("title")
 msgbox strBrowserName
 Browser("name:="&strBrowserName).Navigate "www.gmail.com"
 Browser("CreationTime:=0").OpenNewTab()