Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of QTP interview Questions. Please share your answers
#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


Messages In This Thread
RE: List of QTP interview Questions. Please share your answers - by Ankur - 07-10-2013, 12:04 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)