Micro Focus QTP (UFT) Forums
Amazing Interview Questions - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions)
+--- Thread: Amazing Interview Questions (/Thread-Amazing-Interview-Questions)



Amazing Interview Questions - amanjain42 - 07-09-2013

I want to know the answers following Questions.
write a script for
1. How a function can return two values.? write the code for the function.. ?
2. compare two date "10/10/2013" and "10-octomber-2013" and return true or false.?
3. Write a regular expression for dynamic 6 integer values in the expression "amanjain888073bhilwara"
4. write a script for check the content in a web table and if correct then check the check box at the end of row.?
5. write a script for identifying that multiple web browser are already open and we have to close all the browser except one browser "internet explorer"?
6. What is difference between child-objects and child-items?
7. write a script for click on a particular (15) link in a list of links (like 20 links are their in a web page)
8. how can a run time object is identified by qtp during execution of script.

manual testing.
1. If their is any mistake in the "name" of visiting card, then what will be the severity and priority of this. ?
2. what will be the "verification test cases" for the gmail login page.?


RE: Amazing Interview Questions - Ankur - 07-10-2013

Please write your tentative answers first, rest will follow then.


RE: Amazing Interview Questions - nakulgupta18 - 08-20-2013

1. How a function can return two values.? write the code for the function.. ?
Code:
'''using two output parameters while defining a function
'' defining function with one input and two output parameters
Function TwoValues(inVal, outVal1, outVal2)
'''' processes
''....
''....

''assigning values to output parameters
   outVal1 = 1234
   outVal2 = 2222
End Function

''calling the function
TwoValues x, y, z
MsgBox y
MsgBox z

Code:
'''using arrays
Function TwoValues()
TwoValues = Array("abcd", "efgh")

End Function

x = TwoValues()

MsgBox x(0)
MsgBox x(1)

2. compare two date "10/10/2013" and "10-octomber-2013" and return true or false.?
Code:
date1 = "10/10/2013"
date2 = "10-october-2013"

dateArray1 = Split(date1, "/", -1, 1)
dateArray2 = Split(date2, "-", -1, 1)

If dateArray1(0) = dateArray2(0) And _
UCase(MonthName(dateArray1(1))) = UCase(dateArray2(1)) And _
dateArray1(2) = dateArray2(2) Then
    MsgBox True
Else
    MsgBox False

End If



RE: Amazing Interview Questions - anu05446 - 01-27-2014

or you can use the date functional also here.

Code:
A="10-octomber-2013"
A=Cdate(A)

B="10/10/2013"
B=Cdate(B)

if DateDiff("d",A,B)=0 then
msgbox True
else
msgbox False
End if



RE: Amazing Interview Questions - anu05446 - 01-27-2014

3.
"amanjain\d{4}bhilwara"

sorry use the below one.
"amanjain\d{6}bhilwara"