You are on page 1of 4

1. Tell abt Automation Background?

2. Challenges you faced?

3. there are several browsers are opened how do you close the last opened browser?

Call CloseLatestOpenedBrowser()

Function CloseLatestOpenedBrowser()

Dim oDescription

Dim BrowserObjectList

Dim oLatestBrowserIndex

Set oDescription=Description.Create

oDescription("micclass").value="Browser"

Set BrowserObjectList=Desktop.ChildObjects(oDescription)

oLatestBrowserIndex=BrowserObjectList.count-1

Browser("creationtime:="&oLatestBrowserIndex).close

Set oDescription=Nothing

Set BrowserObjectList=Nothing

End Function

4. What is creation time in Qtp?

During recording, if QuickTest is unable to uniquely

identify a browser object based solely on its test object

description, it assigns a value to the CreationTime test


object property. This value indicates the order in which

the browser was opened relative to other open browsers with

an otherwise identical description.

During the run session, if QuickTest is unable to identify

a browser object based solely on its test object

description, it examines the order in which the browsers

were opened, and then uses the CreationTime property to

identify the correct one.

For example, if you record a test or component on three

otherwise identical browsers, opened at 9:01 pm, 9:03 pm,

and 9:05 pm, QuickTest assigns the CreationTime values 0 to

the 9:01 pm browser, 1 to the 9:03 pm browser, and 2 to the

9:05 pm browser.

5. How to return more than one value from function?

z=returntwo()

msgbox z(0)

msgbox z(1)

msgbox z(2)

msgbox z(3)

Function returntwo()

x="ramesh"
y="srk-hearty.Blogspot.com"

a=10

b="PASS"

returntwo=array(x,y,a,b)

end function

6. how to fetch the values in the particular row of the webtable?

7. i have excel which has 4 column like username , password , status and remarks and it contains 15 set
of values

i want to take each username, password and Login . At the end of the Login need to update the status
based on application msg.?

Datatable.addsheet(“TC”)

Datatable.importsheet Path,Src,”TC”

iRC=Datatable.getsheet(“TC”).getrowcount

for i= 1 to iRC

Datatable.getsheet(“TC”).setcurrentrow(i)

lsuid=datatable.value(“Username”,”TC”)

lspwd=Datatable.value(“Password”,”TC”)

Res=Login(lsuid,lspwd) ‘ This function return the two values such as Res(0) and Res(1)

Datatable.value(“Status”,”TC”)=Res(0)

Datatable.value(“Remarks”,”TC”)=Res(1)

8. How do you retrive the value from AUT?

Using GetRoProperty or GetvisibleText()

9. how do you check whether the page has been loaded or not?

Using SYNC
10. how do you check whether the page has been navigated successfully or not?

Using .Exist

11. what is dictionary object?

Store the value using keys are called dictionary object

12. how to you reverse the array?

Dim A

A=Array("A","B","C","D","E")

val=RevArray(A)

msgbox val(0)

msgbox val(1)

Function RevArray(arrayinput)

Dim i, ubnd

Dim newArray()

ubnd=Ubound(arrayinput)

Redim newarray(ubnd)

For i=0 to ubound(arrayinput)

newarray(ubnd-i)=arrayinput(i)

next

RevArray=newarray

End function

You might also like