QTP Question asked in the
interview:
1. What mean by object repository ?
2. What is the difference between Local and share object repository ?
3. What are the column present in the keyword view of QTP?
4. Write the code for to create the excel object, add new sheet
and save with the time stamp.
Ans:
Ans:
Dim AppExcel
ss="C:\test" & Year(Now) & "_" & Month(Now) & "_" & Day(Now) & "_" & Hour(Now) & "_" & Minute(Now) & "_" & Second(Now) & ".xlsx"
ss="C:\test" & Year(Now) & "_" & Month(Now) & "_" & Day(Now) & "_" & Hour(Now) & "_" & Minute(Now) & "_" & Second(Now) & ".xlsx"
Set AppExcel=createobject("Excel.Application")
AppExcel.Application.Visible = True
AppExcel.Workbooks.Add
AppExcel.Cells(2,1).Value="Test Marks"
AppExcel.Cells(2,2).Select
'Apply the font to Cell
AppExcel.Range("B2").Font.Bold=True
AppExcel.Range("B2").Font.Italic=True
AppExcel.Range("B2").font.Underline=True
'Apply the border to the cell
AppExcel.Range("B2").Borders.linestyle=xlContinuous
'Apply the border to the Cell with Color
AppExcel.Range("B2").Borders.Color=vbRed
AppExcel.Range("D2").Borders.Color=vbGreen
'Fill the Cell with the Color
AppExcel.Range("G2").Interior.ColorIndex=1
'Toget the Color Index
AppExcel.Range("H2").Value=AppExcel.Range("G2").Interior.colorIndex
AppExcel.ActiveWorkbook.Saveas ss
AppExcel.quit
Set AppExcel=Nothing
AppExcel.Application.Visible = True
AppExcel.Workbooks.Add
AppExcel.Cells(2,1).Value="Test Marks"
AppExcel.Cells(2,2).Select
'Apply the font to Cell
AppExcel.Range("B2").Font.Bold=True
AppExcel.Range("B2").Font.Italic=True
AppExcel.Range("B2").font.Underline=True
'Apply the border to the cell
AppExcel.Range("B2").Borders.linestyle=xlContinuous
'Apply the border to the Cell with Color
AppExcel.Range("B2").Borders.Color=vbRed
AppExcel.Range("D2").Borders.Color=vbGreen
'Fill the Cell with the Color
AppExcel.Range("G2").Interior.ColorIndex=1
'Toget the Color Index
AppExcel.Range("H2").Value=AppExcel.Range("G2").Interior.colorIndex
AppExcel.ActiveWorkbook.Saveas ss
AppExcel.quit
Set AppExcel=Nothing
5. What are the different types of framework in QTP?
6. Explain the different frameworks with the advantages and disadvantages.
7. Why framework is required and what are the parameters you
consider for selecting the framework?
8. Explain Major difference between Modular and Keyword driven
framework.
9. How object repository is used to find the object?
10. What is the object model in QTP?
11. What are the types of environment variable and how to use
them?
12. How to import the Excel sheet into data table.
13. QTP Regular exp:
Below are the various regular expressions used in QTP.
Matching Any Single Character (.) eg abc. Will match abc followed by any character.
Matching Any Single Character in a List ( [xy] ) e.g [ab] will match either a or b
Matching Any Single Character Not in a List ( [^xy] ) e.g 1[^23] will match all values between 11 to 19 except 12 and 13.
Matching Any Single Character within a Range ( [x-y] ) e.g : 1[1-3] will match 11,12, and 13.
Matching Any AlphaNumeric Character Including the Underscore ( \w )
Matching Any Non-AlphaNumeric Character (\W) will match any special character other than underscore. Please note case of W in this case.
Matching Zero or More Specific Characters ( * ) This matches zero or more occurrences of the preceding character. e.g ca* will match caa,caaaa,c and so on. Similarly c.* will match c, cs,caaa, and so on, since preceding character here is “.”.
Matching One or More Specific Characters ( + ) Only difference from * is it will match for minimum one character. e.g ta+r will match taar,tar but not tr as in above case.
Matching Zero or One Specific Character ( ? ) A question mark (?) instructs QTP to match zero or one occurrences of the preceding character. For example: te?r matches ter and tr, but nothing else
Matching One of Several Regular Expressions ( | ) e.g new|day will match either of new or day. If we write ne(w|d)ay, it will match neway or neday.
Matching the Beginning of a Line ( ^ ) This will match only if match is found at beginning of line.
Matching the End of a Line ( $ ) This will match only if match is found at end of line.
Matching a word at boundary(\b) e.g new\b will match testnew but not in knewit.
Matches a digit character(\d) Matches a digit value.
Matching a non-digit character(\D) Matches a non digit value
12. How to import the Excel sheet into data table.
13. QTP Regular exp:
Below are the various regular expressions used in QTP.
Matching Any Single Character (.) eg abc. Will match abc followed by any character.
Matching Any Single Character in a List ( [xy] ) e.g [ab] will match either a or b
Matching Any Single Character Not in a List ( [^xy] ) e.g 1[^23] will match all values between 11 to 19 except 12 and 13.
Matching Any Single Character within a Range ( [x-y] ) e.g : 1[1-3] will match 11,12, and 13.
Matching Any AlphaNumeric Character Including the Underscore ( \w )
Matching Any Non-AlphaNumeric Character (\W) will match any special character other than underscore. Please note case of W in this case.
Matching Zero or More Specific Characters ( * ) This matches zero or more occurrences of the preceding character. e.g ca* will match caa,caaaa,c and so on. Similarly c.* will match c, cs,caaa, and so on, since preceding character here is “.”.
Matching One or More Specific Characters ( + ) Only difference from * is it will match for minimum one character. e.g ta+r will match taar,tar but not tr as in above case.
Matching Zero or One Specific Character ( ? ) A question mark (?) instructs QTP to match zero or one occurrences of the preceding character. For example: te?r matches ter and tr, but nothing else
Matching One of Several Regular Expressions ( | ) e.g new|day will match either of new or day. If we write ne(w|d)ay, it will match neway or neday.
Matching the Beginning of a Line ( ^ ) This will match only if match is found at beginning of line.
Matching the End of a Line ( $ ) This will match only if match is found at end of line.
Matching a word at boundary(\b) e.g new\b will match testnew but not in knewit.
Matches a digit character(\d) Matches a digit value.
Matching a non-digit character(\D) Matches a non digit value
Common Question asked in the interview:
1. What mean by Statement coverage and solve the given example.
2. What are the parameters considered during Test estimation?
3. What mean by load testing, Volume Testing, Stress testing?
4. What mean by configuration management?
5. What mean by verification and validation?
Verification
|
Validation
|
(not the actual final product) In
development phase to determine whether they meet the specified requirements
for that phase.
|
At the end of the development
process to determine whether it satisfies specified business requirements.
|
Ensure that work products meet
their specified requirements.
|
The product fulfills its intended
use when placed in its intended environment.
|
Building the product right?
|
Building
the right product?
|
Plans, Requirement Specs, Design
Specs, Code, Test Cases
|
The actual product/software.
|
Review, Walkthroughs, Inspections, Execution
is not required
|
Testing, Execution is required
|
6. Explain the SDLC and STLC cycle.
7. What are the parameters that we consider while doing Load
testing?
8. Explain Equivalence and boundary value testing with example.
9. What mean by User Acceptance testing and what it involve?
10. Explain test plan and what it involve?
11. What are the advantages of Agile Methodology?
9. What mean by User Acceptance testing and what it involve?
10. Explain test plan and what it involve?
11. What are the advantages of Agile Methodology?