QTP Interview Questions

Showing Questions 1 - 20 of 46 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page:
  •  

    What is the file extension of the code file & object repository file in QTP?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Vijaya Kumar B

    • Aug 2nd, 2005


    File extension of 
    -- Per test object rep :- filename.mtr 
    -- Shared Oject rep :- filename.tsr 
     
    Code file extension id script.mts

    madhupriya

    • Oct 2nd, 2017

    Test script extension - mts (Modular Test Script)
    Local repository - mtr (Modular Test Repository)
    Shared repository - tsr (Test Shared Repository)

    Amit

    • Dec 27th, 2016

    Unable to find .mts file .

  •  

    Explain in brief about the QTP Automation Object Model.

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Venkat Potluri

    • Jul 28th, 2005


    Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.  
    You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program 

  •  

    What are the Features & Benefits of Quick Test Pro(QTP)..?

    Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation “zero-configuration” Keyword Driven testing technology in QuickTest Professional 8.0 — allowing for fast test creation, easier maintenance, and more powerful data-driving capability Identifies objects with Unique Smart Object Recognition, even if they change from build to...

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: praveena

    • Sep 21st, 2005


    qtp is mainly used for functionality testing.qtp is user friendly both technical and non technical users can easily access.qtp has two views

    keyword view and expert view

    in keyword view when u record a test it genarates the script in tree format.it is very easy to understand.if u want to view  the vbScript use the expert view.

    qtp has active screen using that u can enhance the script with out navigating to the application.like u can insert checkpoints and synchonization points.

    qtp has automated documentation.when u start recording it genarates the autodocumentation in plain english.

    using qtp we can parametarize objects,checkpoints,datadriventables.this will give more flexibility.

  •  

    What is Smart Identification in QTP

    Gopi

    • Jun 10th, 2015

    Is it possible to assign properties in smart identification, if yes how?

    Mani

    • May 14th, 2012

    Smart identification to identify the dynamic object smartly, this is used only for web applications. The base filter information will be in mandatory property and the associated properties details wil...

  •  

    I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this?

    Sreedhar Reddy

    • May 18th, 2014

    By Creating WSH(Windows ShellScript Host) Object We can open notepad.

    Code
    1. set oWSH = CreateObject("wscript.shell")
    2. oWSH.run "obsalutepath of notepad"

  •  

    What is the command in QTP to invoke IE Brow?

    gnanathesigan

    • Aug 14th, 2017

    Hi,
    I didnt write the code for launching application and Url, but if i run the code automatically chrome browser will open and url will set. I dont know how to control this. (i.e) While Recording the Script, I used chrome browser and URL, same thing will applied when i am running the code.

    kaneez

    • Mar 15th, 2013

    SystemUtil.Run

  •  

    QTP Regular Expression

    What is the significance of regular expression in QTP?

    Star Read Best Answer

    Editorial / Best Answer

    priyankvyas  

    • Member Since Dec-2008 | May 6th, 2009


    Regular expression is always used to make our search globalize.

    To execute the test in QTP every object is searched in the object repository (OR). In real time applications some object's properties always keep changing, so at the time of execution script fails. To overcome it we use "regular expression" for that particular object's property. For example:

    1) Record a test where you are inserting one order and than faxing the same order.

    2) The order number that is generated during recording may 21 and "Fax Order window title" is generated and saved into OR as "Fax Order No. 21"

    3) Now execute the same test, the script will fail because this time order no is modified as 22 and accordingly "Fax Order window title" is modified as "Fax Order No. 22".

    4) This time the object "Fax Order No. 22" is not identified or you can understand object is not matched (find) into OR.

    5) To make this search better we modify the text property of object into OR as "Fax Order No.*" this will search all the occurrences of window that has text as "Fax Order No"

    6) We can also write it as "Fax Order No. [0-9]" because fax order no is a numerical value and this will search only numbers after "Fax Order No. "

    So this is the purpose of regular expression in QTP.

    aarati

    • Nov 9th, 2009

    Using RE we can make the QTP to recognize same object with its varying name.For example, a window having title as "Employee NO. 7"If I want to pass data to multiple Employee No. Windows, So I have to use RE as "Employee No..*" in Object Repository..

  •  

    How to use the Object spy in QTP 8.0 version?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: sivaprasad

    • Jul 29th, 2005


    There are two ways to Spy the objects in QTP 
    1) Thru file toolbar 
    ---In the File ToolBar click on the last toolbar button (an icon showing a person with hat). 
     
    2) Tru Object repository Dialog 
    ---In Objectrepository dialog click on the button"object spy..." 
     
    In the Object spy Dialog click on the button showing hand symbol. 
    the pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object 
     
    if at all the object is not visible..or window is minimised then Hold the Ctrl button and activate the required window to and release the Ctrl button. 
     
     

  •  

    Does QTP support Linux, Unix and Solaris?? Does QTP has a separate set up for Linux, UNIX and Solaris??Will the scripts recorded on Windows work on Linux, UNIX and Solaris?

    Star Read Best Answer

    Editorial / Best Answer

    Brahma Sagar Gunda  

    • Member Since May-2006 | May 5th, 2006


    The following list the Operating Systems that QTP supports, please refer:

    - Windows 2000-Service Pack 3 or Service Pack 4

    - Windows XP-Service Pack 1 or Service Pack 2,

    - Windows 2003 Server.

    Note: QuickTest Professional is supported on Windows XP Service Pack 2 only if the execution prevention mechanism (also known as DEP-data execution prevention and NX-no execution) is not activated

    I believe this answers your questions and will thereby close this service request. Should you require further clarifications, please do not hesistate to let me know. Thanks.

    Regards,

    Brahma Sagar

    Gaurav Sharma

    • Oct 31st, 2012

    Hi Vish,

    Kindly install microsoft script debugger and then restart the QTP.

    Regards,
    Gaurav

    Gaurav

    • Oct 20th, 2011

    Yes it true that QTP works on Windows OS only but it works fine on browsers others than IE as well(Mozilla Firefox is supported)

  •  

    How to execute qtp script from command prompt?

  •  

    what is a file system object in QTP

    Star Read Best Answer

    Editorial / Best Answer

    chitta10  

    • Member Since Jul-2009 | Mar 29th, 2010


    File system object is to create a file where you can store your informations and also read. Have a look to my exemple I think you can understand it.

    SystemUtil.Run "iexplore.exe","","C:Documents and Settingsuser18Desktop",""
    Browser("Google").Page("Google").Link("Gmail").Click
    Browser("Google").Page("Gmail: Email from Google").Sync
    Dim x,y
    Set x = CreateObject("Scripting.FileSystemObject")
    Set y = x.Createtextfile("d:testfile.xls",true)
    If Browser("Google").Page("Gmail: Email from Google").Exist Then
    y.writeline("step1 login details is pass")
    else
    y.writeline("step1 login details is fail")
    End If
    Browser("Google").Close

    Thanks and regards,
    CHITTA.

  •  

    WebElement recognized by QTP but can't click on it

    Hicould somebody please help. Working on a web app. it has two sections on the left hand side is a list of folders or options. when some option is clicked on, on the right hand side all the stuff in that folder is populate. QTP recognizes the object and in the summary results shows what was clicked on, but nothing happens. not sure if there is something behind this object or....here is what i have...

    rakesh

    • May 9th, 2018

    Browser("WebAPP").Page("WebPage").WebElement("Innertext:=XXX","HTML Tag:=NOBR","Index:=0").click
    Browser("WebAPP").Page("WebPage").WebTable("Root").WebElement("XXX").highlight
    createobhect("wscript.shellscripting").run {"ENTER"}
    Hope so this willwork.

    Deepa

    • Jan 28th, 2016

    Its working, Thank you

  •  

    How to instruct QTP to display errors and ther description in the test results instead of halting execution by throwing error in the mid of execution due to an error(for example Object not found)?

    Suvendu

    • Apr 21st, 2015

    Hi,
    is there any alternative way to generate report in qtp without using reportevent method ?

    Suresh

    • Feb 21st, 2015

    On Error Resume Next
    your code
    reporter.reportevent micFail,"error", err.description
    On Error GoTo 0

  •  

    For Loop problem in QTP

    I am using the For Loop to get data from the data table. The summary code is:C=datatable.getrowcountFor i=1 to cmsgbox Datatable.Value("Column1")Next'The message box always returns data of row 1. Irrespective of the iteration. How is it possible.

    rohan

    • May 22nd, 2015

    Rc = datatable.getsheet("sheetname").getRowCount
    to increase the loop

    for i = 1 to rc
    datatable.SetCurrentRow(i)
    obj1 = datatable.value("Columnname","sheetname")

    next

    helloqtp

    • Jul 5th, 2014

    I think the issue lies in the settings , where you have to check for one iteration only .. by default it remains checked as for all the rows ..

  •  

    How do you retrieve substring from another string in QTP

    Bhavin

    • Oct 18th, 2016

    Simplest Answer ever :

    Code
    1. Simplest answer ever:
    2. Dim objString
    3. objString = "This is the string"
    4.  
    5. Dim objFound
    6. objFound = "the string"
    7.  
    8. if Instr (objStr, objFound) Then
    9.     msgbox "String found"
    10. Else
    11.      msgbox "String not found"
    12. End If

    sneha

    • Mar 4th, 2015

    Code
    1. Dim StringValue="Country"
    2. SubstringValue=mid(StringValue,2,4)
    3.  
    4. msgbox SubstringValue
    5.  
    6. Returns Substring from starting position  2 and 4 character following
    7.  
    8. Returns "ount"
    9.  

  •  

    Count Number of Links

    How to count number of links in a web page using QTP?

    Star Read Best Answer

    Editorial / Best Answer

    calvin_29  

    • Member Since Sep-2010 | Sep 20th, 2010


    This is the script, We should first create an object

    set oDesc=description.create()
    'prefer descriptive programming...batter
    oDesec("micclass").value="link"
    'get all child objects in an variable
    set oLink=browser("name:=.*").page("title:=.*").childobjects(oDesc)
    'count all links
    intC=oLink.count
    'Use print or msgbox or 'reporter.reportevent'
    print intC
    'it glows links in the web page
    for i=0 to intC-1
    oLink(i).highlight
    next
    set oLink=nothing
    set oDesc= nothing

    'Offer me comment if it works properly

    rohan

    • May 22nd, 2015

    By using descriptive programming we can count and displays the number of links in web page Set ObjDesc = Description.Create ObjDesc.Add "micclass","Link" Set ObjBr = Browser("name:=*).Page("title:=...

    yogi

    • Dec 27th, 2014

    Your code doesnt work on set links line it throws an error as not supported method

  •  

    How to find out the regularly changing value in a single line?

    How to find out the regularly changing value in a single line? Tell me How many ways are there?

    Ex: India having 100 crore population now.

    here 100 is changing regularly. How to write the Script for this?

    Kishan

    • May 10th, 2016

    Below is the correct program.

    Code
    1. str="India having 148 crore population now."    
    2. set obj=new RegExp
    3. obj.Global=True
    4. obj.Pattern="[0-9]"
    5. set s=obj.Execute(str)
    6. for each x in s
    7. y=y&x
    8. Next
    9. msgbox y

    Divya

    • Mar 28th, 2016

    Code
    1. str="India having 100 crore population now."
    2. newarr=split(str)
    3. For i = 1 To ubound(newarr) Step 1
    4.         If isnumeric(newarr(i-1)) Then
    5.                 msgbox newarr(i-1)
    6.         End If
    7. Next

  •  

    How to write QTP results to a text file or an Excel file ?

    I need to write the QTP results to a text file or an Excel file as i don't want to see the results in QTP results window.Please Can anybody provide the exact code for itUrgent...............................Thanks in advanceUday

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: srinivas Potnuru

    • Jun 6th, 2006


    Hi all,

    We actually have few functions to add the results to the Excel File instead in the QTP Results Window.

    Solution description: We will be using a seperate Sheet by name "Results" in which the Results of the Test will be appened.

    There are 2 functions

    1) initOutExcel(sTablePath)

             Description : This function is to initialize a particular Excel Where you want to update the Results of the QTP Tests.

    2) WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

            Description : This function appends the Result of a  Test to the end of the existing results.

    You can modify the below functions to suite your requitrement.

    CODE:

    Function initOutExcel(sTablePath)

      Datatable.addSheet "Results"

      Datatable.importSheet sTablePath, "Results","Results"

      iParamCount = Datatable.getSheet("Results").getParameterCount

      if iParamCount = 0 Then

         Datatable.getSheet("Results").addParameter "S.No",""

        Datatable.getSheet("Results").addParameter "Status",""

        Datatable.getSheet("Results").addParameter "Functionality",""

        Datatable.getSheet("Results").addParameter "Description",""

      End If

       Datatable.ExportSheet sTablePath,"Results"

    End Function

    Function WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

      Datatable.addSheet "Results"

      Datatable.importSheet sTablePath, "Results","Results"

      iRowCount = Datatable.getSheet("Results").getRowCount

      Datatable.getSheet("Results").setCurrentRow(iRowCount+1)

      Datatable("S.No","Results") = iRowCount+1

      Datatable("Status","Results") = sStatus

      Datatable("Description","Results") = sDescription

      Datatable("Functionality","Results") = sFunctionality

      Datatable.ExportSheet sTablePath,"Results"

    End Function

    hk

    • Feb 23rd, 2007

    Can somebocdy explain  how to  specify the parameters needed to call  these functions?

  •  

    What is QTP script to find whether perticular city in weblist in web page or not?

    manoj

    • Aug 17th, 2016

    Just an easy
    set obj = description.Create()
    obj("html tag").value="SELECT"
    obj("index").value =
    Browser("title:=.*").page("title:=.*").WebList(obj).Select "DELHI"

    Krishna

    • Aug 7th, 2015

    cityName = "Delhi" DropDownCityNames = browser("title:=.*").page("title:=.*").weblist("name:=city").GetRoProperty("all items") ArDropDownCityNames = split(DropDownCityNames,";") For each x in ArDr...

  •  

    Recovery Scenario and On Error Resume Next

    What is the difference between 'Recovery Scenario' and 'On Error Resume Next'?

    Star Read Best Answer

    Editorial / Best Answer

    swapna.raut  

    • Member Since Dec-2009 | Dec 10th, 2009


    "On Error Resume Next" is used when you are sure about the step where the error can occur.

    Whereas, Recovery Scenario can be used to handle unxpected event or error.

    Basanagouda

    • Jul 20th, 2011

    Adding to aditya_12 answer If known errors we need to handle using line code (and code becomes lengthy) and same cannot be used in other part of script (unless made it as function) but recovery scen...

Showing Questions 1 - 20 of 46 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page: