QTP Interview Questions

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

    How To run Shared object repository files in QTP ?

    Star Read Best Answer

    Editorial / Best Answer

    dsharma  

    • Member Since Feb-2006 | Jul 3rd, 2006


    Click on Test->Settings

    Click on Resources Tab

    At the right-bottom change object repository type from per-action to shared.

    Once you have saved a test script with per-action type of object repository you cannot change it to shared.

    Deepak

    • Jul 11th, 2006

    I would like to know is there any function to be written to include 2 different Object repository. If yes can i have the script.

  •  

    What is the method used to focus on particuler field.I need the script.I will give example.I flights application login page by default the focus is on username field. for this i will check the focus was there or not by using getroproprty method but if focue is not there which method i need to use.

    kallol raha

    • Jul 19th, 2006

    To explicitly set focus on a control use .object.focus

    sreepalgummalla

    • Jun 8th, 2006

    hi guyss.....What is the method used to focus on particuler fie...?getroproperty: retrives the pericula property.setroproperty: set the property to perticula object.... to focus to the perti...

  •  

    Object name is changing while executing test in QTP

    when i am recording in QTP the object name of the text box is text1 and it is changing while i am executing. whenever i am opening the login window it is assigning new names If it is like this how can i test the application

    Star Read Best Answer

    Editorial / Best Answer

    b.sainarayanarao  

    • Member Since Oct-2007 | Oct 23rd, 2007


    go to Resources menu-Object Repository-select the particular text object in left window pane. In right window pane select attached text column field value, a browse icon ('<#>') becomes visible and  click on  it and  select  Regular  expression  checkbox (click on 'No' option in a appeared dialogbox) and  exactly in the place  of  1  write  as  [0-9]*  
    example: text 1           'before  replacement
                    text [0-9]*    'after replacement  is valid
                    text[0-9]*    'after replacement  is not valid because no space in between text and regular expression

    shreyas

    • Jun 27th, 2006

    Hi You can test the window by using regular expression.

  •  

    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?

  •  

    Reusuable components in QTP

    How to create reusuable components in QTP?

    Star Read Best Answer

    Editorial / Best Answer

    md_vinodh  

    • Member Since Apr-2008 | Jun 10th, 2008


    Hi,

     If are you uasuing Test Script, please follow the below steps:
     
    1) Create the Test Script in Expert View
     2) Right click and select Action Properties
     3) Select the check box in 'Resuable Action'
     4)  Provide the  Action  name or  Script  Action name

     If u like to call the action in different location use the following steps:
     
     1) QTP have three function like ( Insert to New call, Insert to Copy and Insert to Existing )

     U can use any one function and call the ur action properties

    Let me know, if u have query

     
     

  •  

    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 make QTP understand the difference with same type of objects

    Suppose there are 10 of check boxes in a page and i have to choose the 6th one, how to do that through script?

    Star Read Best Answer

    Editorial / Best Answer

    researchingmiddleware  

    • Member Since Oct-2008 | Oct 8th, 2008


    Use the Ordinal identifiers (index) property...each of the objects will have a different index value

  •  

    How to execute qtp script from command prompt?

  •  

    Connect QTP to QC

    How to connect QTP to Quality Center?

    Star Read Best Answer

    Editorial / Best Answer

    Satyesha  

    • Member Since May-2009 | Mar 29th, 2011


    Hi,
    We can?connect to QC from QTP through?QTP File options or direct Icon on QTP window.

    Go to your QTP?File->QC connections->Provide the Server URL->Login credentials->Project and Domain details to which you want to connect.
    Note:Check the Option to Auto connect to QC?with each QTP session , in order to avoid entering these details again & again.

    Satyesha

    • Mar 29th, 2011

    Hi,We can?connect to QC from QTP through?QTP File options or direct Icon on QTP window.Go to your QTP?File->QC connections->Provide the Server URL->Login credentials->Project and Domain details to ...

  •  

    How to find the number of WebButtons in a screen while runtime?

    Star Read Best Answer

    Editorial / Best Answer

    amereetto  

    • Member Since Jul-2007 | Mar 27th, 2011


    Hi,


    Below is the example to find the number of WebButtons in a page. I have have coded iot for Google page:

    Dim oDesc 'Description Object
    Dim colObject 'Object Collection

    Set oDesc = Description.Create
    oDesc( "micclass" ).value = "WebButton"
    'Additional property- for more focused and controlled collection
    oDesc( "Type" ).value = "submit"
    Set colObject = Browser( "name:=Google").Page("title:=Google").ChildObjects( oDesc )
    Msgbox colObject.Count 'Returns the number of webbutton

    Thanks.
    Debajit

  •  

    QTP Sync

    Explain about Sync with an example

    Star Read Best Answer

    Editorial / Best Answer

    ch.bhaskar.mca  

    • Member Since Oct-2007 | Apr 6th, 2011


    Hi,

    As the name specifies, "Synchronization Point" is nothing but to say QTP to wait till some specified condition occurs. You can specify the conditions.

    We need Synchronization Point because we are always not sure how much time it takes for an Object to get loaded to a page/window.

    Let's take an example of "Login" page of any application. You want to provide "UserName" in the UserName field after opening the site via QTP.We can provide value only after "UserName" field is visible. But sometime it may take 10 seconds for the "UserName" field to be appear in the Login page. Sometime it may take 30 seconds (Depends upon the internet speed).At this point QTP script fails as the object is not displayed in the page. So here what we do through "Synchronization Point" is to tell QTP to wait untill the "UserName" field appears on the page, may it take 10 secs or 30 secs.

    There are 2 ways (for Web Application) you can acheive this as follows:

    Quote:> Browser("").Sync (Only in case of Web App) : QTP waits untill all the objects are loaded to the Browser

    > WaitProperty (Any type of App) : QTP waits untill the specified condition is satisfied
    Following is an example of "WaitProperty"

    Quote:Syntax: Object.WaitProperty "Property Type","Property Value",TimeOut

    Ex: Browser("Login").Page("Login").WebEdit("UserName").WaitProperty "visible",True,20000
    Browser("Login").Page("Login").WebEdit("UserName").Set "bhaskar"

    In the above example QTP waits untill the WebEdit "UserName" is visible in the page.Then it sets the UserName in the field.

    Hope it helps you.

  •  

    How to record Java application in QTP 8.2?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: santosh

    • Jun 28th, 2006


    1)First install java-addin along with QTP.

    2)Set the reqired properties for objects to identify the objects in Tools..>Object identification(Mandatory and assistive properties)

    3)Test--->Click Record-->Select javaoption.or click F3.

    The script will come as..

    Javawindow("").JavaInternalframe("").Javalist("").Select""

  •  

    How do you test JAVA tree objects ?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Taji

    • Jun 24th, 2006


    For testing Java Objects you need to install an additional Java Plugin. This will enable QTP to identify java objects. This should also solve the java tree problem.

    if you already have installed the java plug-in and asking for a method to test java tree objects, there is no single answer i can give. but you might have to apply your own logic through descriptive programming.

    Prashant

    • Jun 24th, 2006

    Hi Thanks for the answerI have installed java plugin object and have tried to give a call to the java object tree I just want to expand the Tree nodeplease can you send a small sample code which tests the Window explorer regardsPrashant

    Taji

    • Jun 24th, 2006

    For testing Java Objects you need to install an additional Java Plugin. This will enable QTP to identify java objects. This should also solve the java tree problem.if you already have installed the ja...

  •  

    How is automation used in QTP for regresstion testing ?

    Star Read Best Answer

    Editorial / Best Answer

    mana.kare  

    • Member Since Jan-2007 | Aug 16th, 2007


    Hi,

    I am giving an expample of regression testing.

    Example:

    We have a "Yahoo" web application. Suppose if yahoo is going to add a new features in their application it has to verify the existing web page along with new features. If it is adding new features for every two months, it has to test existing and new features every time. The repeated testing is nothing but regression.
    (means the new functionality does not effect on the existing functionality).

    we are using QTP to test the existing functionality is working proprly or not.

    Anil

    • Sep 13th, 2007

    Regression testing is the testing done to verify the defect fix. For example if you encountered a defect and report to a developer and developer fixed it and deliver the code again, then you verify that the defect is fixed. This testing is called as regression testing. I hope you understood.

  •  

    What are the advantages and disavantages of QTP over Rational robot and which one is better?

    Star Read Best Answer

    Editorial / Best Answer

    md_vinodh  

    • Member Since Apr-2008 | Jun 30th, 2008


    Hi,

     All Testing tools are best , each one of them have their own advantages and disadvantages.

     Please find your Requirements, Time, Cost and other external factors, which one fullfil your requirements, it's best for you ....based on that choose the product

    Let me know

    Regards
    Vinodh M

    md_vinodh

    • Jun 30th, 2008

    Hi, All Testing tools are best , each one of them have their own advantages and disadvantages. Please find your Requirements, Time, Cost and other external factors, which one fullfil your requirements, it's best for you ....based on that choose the productLet me knowRegardsVinodh M

  •  

    How to write code in the Expert View for a Search engine?

    Pl. I need help in writing code in the Expert View for a Search engine. As we search ex: 'apple' it gets a Search criteria with (1 2 3 4....Next) pages. so it suppose to click the "Next" button until "Next" is disable. As i'm doing data driven for search criteria by recording with clicking 5 times "Next" button but when in the Run session some criteria is not displaying the same no.of pages...So, how...

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Guest

    • Jan 12th, 2007


    You can use object spy to get the name of the first page number (i.e. the "#1" button string will have either a 1 or a 0 in its string.)

    Then you can change this to a variable(say "x") and then use descriptive programming for the string.

    You will then have a Loop statement (preferably a For...Next Loop) to check on the max number of page number links that are available on the primary screen (say 5 is the max) and see if "Next Button" is still high lighted.

    If it is, click on next after reaching 5 till "Next button" is disabled or does not exist.

    When Next button is disabled, the Value of "x" is the total number of result pages(ie if the #1 link starts with a logical number of 1) and x +1 if the #1 link starts with a logical number of 0.

    Guest

    • Jan 12th, 2007

    You can use object spy to get the name of the first page number (i.e. the "#1" button string will have either a 1 or a 0 in its string.) Then you can change this to a variable(say "x") and then use de...

  •  

    How do you automate the user login to web application ?

    In QTP, How can I call different users to logon to a web application under test, one after the other? (In a while loop)I will appreciate your help.Thanks,

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: srinivas potnuru

    • Jun 13th, 2006


    Hi,

    there are so many ways

    1) Keeping the usernames and passwords in 2 arrays and then looping them

      as below


       usernames =array( "test1","test2","test3" )
       passwords = array ("pass1","pass2","pass3")

       i = 0
       iCount =  ubound(usernames)
       do  While (i <= iCount)   

            'code to set the username password in the application and do the other  steps as well so that u can again enter the username and password  in the application
            i=i+1
       loop

    2) Keeping the values in the Datatable and doing the same using datatable functions. 

    srinivas potnuru

    • Jun 13th, 2006

    Hi,there are so many ways1) Keeping the usernames and passwords in 2 arrays and then looping them  as below   usernames =array( "test1","test2","test3" )   passwords = array (...

  •  

    Is there any Frame work for Descriptive programing

    Qtp is not identifying any object in the application so i thought of going to descriptive programming how do u use this with the frame work which is already existing? and more features to use descriptive programming?

    Star Read Best Answer

    Editorial / Best Answer

    Srinivasaraomunagala  

    • Member Since Jul-2007 | Jul 31st, 2007


    There is no specific frame work for the Descriptive programing. When the qtp is not able to recognize the object we need to go for Low level recording. It will treat the object as winobject/webobject

    ven

    • Oct 31st, 2007

    Hi all,I know how to create a checkpoint to an object in keyword view using recording and active screen of application.I tried to create a  standard checkpoint to an object in expert view using d...

  •  

    What is Per action and Shared recording?

    Give advantages and disadvantages of Per action and Shared ?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: srinivas potnuru

    • Jun 9th, 2006


    Hi,

    Both Per action and shared has its own advantages and disadvantages.

    Per Action:

    ? When we ?Record by setting the repository to Per action each and every action will have its own repository. So each action will be independent with the other action w.r.t the Object Repository.

    Shared:

    When we record by setting the Object Repository to shared mode, all the actions in that particular Test can use the same Shared Object Repository . i.e there will be only one repository which contains all the objects that are required across all the actions.

    I am giving this as per my Knowledge there may be some more as well...

    TypeAdvantagesDisadvantages
    PerActionThe actions can be reused and as the repositories are individual there wont be any problem with the Objects.If there are few objects that are being used in more than one action then there will be a duplicate occurence of the object in the object Repository as the object repositories are different for different actions
    SharedThere will be only one Object Repository and can be maintained easily
    Shared

    Even if there is a need of using same object in more than one action, then there will be only one occurrence of the Object in the Object Repository.As the Object Repository is shared.

    ??????????

    srinivas potnuru

    • Jun 9th, 2006

    Hi,Both Per action and shared has its own advantages and disadvantages.Per Action: ? When we ?Record by setting the repository to Per action each and every action will have its own repository. So ea...

  •  

    Write sample code of Descriptive programming for yahoo login form?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: srinivas potnuru

    • Jun 12th, 2006


    This is the code for Yahoo Photos Website you can do the same for the yahoo by changing the values in the required places.
    CODE: Browser("title:=Yahoo! Photos*.*")
    .page("title:=Yahoo! Photos*.*")
    .WebEdit("name:=login")
    .set "srinivas" Browser("title:=Yahoo! Photos*.*")
    .page("title:=Yahoo! Photos*.*")
    .WebEdit("name:=passwd")
    .set "test"Browser("title:=Yahoo! Photos*.*")
    .page("title:=Yahoo! Photos*.*")
    .WebButton("name:=Sign In").click

    Prasanna Laxmi

    • Jul 4th, 2006

    Hi Srinivas, If you have any documents related to "Descriptive Programming", Can you please send those documents. I am in urgent need of that document.Thanks in Advance,Prasanna Laxmi

    srinivas potnuru

    • Jun 12th, 2006

    This is the code for Yahoo Photos Website you can do the same for the yahoo by changing the values in the required places. CODE: Browser("title:=Yahoo! Photos*.*") .page("title:=Yahoo! Photos*.*") ...

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