Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of QTP interview Questions. Please share your answers
#1
Not Solved
1. In QTP AOM how to open a file without giving the full path? is there any way to find a file in the system just by giving its name? [You have to write a vb script to find the file]?
2. If you are trying to execute Browser("creationtime:=1")…..but there is only one browser with creationtime=0….what will happen explain in detail?
3..What are the factors you consider while choosing the frameworks? if you want to go for DDF can't we use KDF for that?
4. When you search in google you get no of links in results page. So write a program to click on last link in results page.
5. How do you capture the RAM size of each system you are working.
6.Write a script to click on a link in a WebTable….also once clicked on the link how do you come out of the loop?
6. What are different options if you want to share values between different actions.[without using environment variables]
7. In Cycle 1 your script passed but in Cycle 2 its failed. How you debug? what could be the different reasons for failure?
Reply
#2
Not Solved
Please come up with your own answers first. Everybody else will chip-in next.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
Here is my approach...please add your comments as well. Thanks

1. In QTP AOM how to open a file without giving the full path? is there any way to find a file in the system just by giving its name? [You have to write a vb script to find the file]?
No idea
2. If you are trying to execute Browser("creationtime:=1")…..but there is only one browser with creationtime=0….what will happen explain in detail?
When tried its closing the browser with craetiontiem:=0 though I mentioned Creationtime:=1.

3..What are the factors you consider while choosing the frameworks? if you want to go for DDF can't we use KDF for that?
- I will check the following factors before choosing a framework
Who is the audience going to execute it.
Complexity of the application
Does the application needs to be tested with different sets of data.
No of Test scenarios its needs to cover.

4. When you search in google you get no of links in results page. So write a program to click on last link in results page.
First of all I am not getting how to count number of search pages in results page.
When I spy on those page numbers links I am not finding unique property. So I am not getting how to approach it.
Please give an idea on how to approach it then I will try to write a program.

5. How do you capture the RAM size of each system you are working.
Code:
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer
msgbox Round(objComputer.TotalPhysicalMemory/(1024*1024*1024),3)
Next

6.Write a script to click on a link in a WebTable….also once clicked on the link how do you come out of the loop?
We have to use flag to come out of the loop when condition met.

7. What are different options if you want to share values between different actions.[without using environment variables]
1. Data tables

8. In Cycle 1 your script passed but in Cycle 2 its failed. How you debug? what could be the different reasons for failure
1. Change in Object Properties
2. New features might be added to the application
3. New changes might not be recognized by QTP
Reply
#4
Not Solved
1.

This answer is available on the web.
Here is a fully recursive example that calls the procedure you posted for all folders and subfolders under the current active folder ...

Code:
Dim fso

' create a global copy of the filesystem object
Set fso = CreateObject("Scripting.FileSystemObject")

' Call the RecurseFolders routine with name of function to be performed
' Takes one argument - in this case, the Path of the folder to be searched
RecurseFolders ".", "RenameIt"

' echo the job is completed
WScript.Echo "Completed!"

Sub RecurseFolders(sPath, funcName)
Dim folder

  With fso.GetFolder(sPath)
    if .SubFolders.Count > 0 Then
      For each folder in .SubFolders

         ' Perform function's operation
         Execute funcName & " " & chr(34) & folder.Path & chr(34)

         ' Recurse to check for further subfolders
         RecurseFolders folder.Path, funcName

      Next
    End if
  End With

End Sub

Sub RenameIt(folPath)
Dim sName, fil

  ' go thru each file in the folder
  For Each fil In fso.GetFolder(folPath).Files

  ' check if the file name contains underscore
    If InStr(1, fil.Name, "&") <> 0 Then

  ' replace '&' with 'and'
      sName = Replace(fil.Name, "&", "and")

  ' rename the file
    fil.Name = sName

    End If
  Next
end sub

2. That's how it is supposed to work, when there are no other browsers available the only browser that is present defaults to 0 irrespective of its CreationTime property.

3. It depends.

4.
Code:
set oDesc = Description.Create
oDesc("micclass").Value = "Link" ' All Links
oDesc("outerhtml").Value = "<A onmousedown.*" ' Narrow down to the results link

Set oLinks = Browser("ankur jain - Google Search").Page("ankur jain - Google Search").ChildObjects(oDesc)

msgbox oLinks.Count

oLinks(9).Click

6. Use
Code:
Exit For

7. Datatables, text files, exernal excel files, database (All depends upon your framework)

8. There can be tons of reasons.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#5
Not Solved
Thanks for your information Ankur....they are very helpful for me. Even in Google I could't able to get the correct response for some of them.

Need some more information....

4. When I use the above code.. links count its giving 0, and when
I spy on google results link it showing "outerhtml" property value as
"<a class="fl" href="/search?q .*"

Even using that I am neighter getting the correct count of links nor its clicking on last link.

Where I am making the mistake?

8. Can you please list at least 5 reasons? so that I can get some idea...

Thanks!!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Interview Questions praveen.sharma 4 5,861 08-23-2022, 02:07 PM
Last Post: ahmad3029
  Interview Questions supputuri 12 13,404 08-23-2022, 11:45 AM
Last Post: ahmad3029
  Interview question nandha 0 1,862 03-28-2018, 03:32 PM
Last Post: nandha
  Few Interview Question asked in various Companies.. shailesh.2.singh@bt.com 1 3,430 08-08-2017, 09:24 AM
Last Post: mallika199317@gmail.com
  Interview Question raghavaqtp 1 3,764 12-20-2014, 09:55 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)