QTP Interview Questions and Answers
Question - 111 : - How you can check if parameter exists in Datatable?
Answer - 111 : -
To check whether if parameter exists in data table we will use the code
on error resume next
val=DataTable(“ParamName”, dtGlobalSheet)
if err.number<>0 then
‘Parameter does not exist’
else
‘Parameter exists
end if
Question - 112 : - In QTP explain what is keyword driven automation framework?
Answer - 112 : -
In keyword driven automation framework, the focus is mainly on keywords/functions and not the test data. It means the complete focus is on creating functions which maps the functionality of the application.
Question - 113 : - In QTP how you can use Xpath to identify objects?
Answer - 113 : -
Xpath can be used to identify only web objects. We can use the following code to identify objects.
Set oPage=Browser(“myGoogle”).Page(“myGoogle”)
oPage.WebEdit(“xpath:=//INPUT[@name=‘nameofeditbox’]”).Set “search term”
‘Enter value in google edit box
Question - 114 : - Explain how you can delete excel file in QTP?
Answer - 114 : -
To delete excel file in QTP,
Set fo = createobject(“Scripting.filesystemobject”)
fo.deletefile(“C:\xyz.xlsx”)
Set fo=nothing
Question - 115 : - What factors affect bitmap checkpoints?
Answer - 115 : -
Bitmap checkpoints are affected by screen resolution and image size.