Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...



This is Ajay i have few douts if anybody know pls give me
reply.

1. i have opend 2 gmails i am working with 1 gmail i want
to close other gmail by usig script.

2.i have 10 links in a page all of them have same
properties& names i want to click on 5link by using script.

3.i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.

4. size of objectrepository.
5.what r problems we get during writing the script.
6.is it possible to compare to excel sheets in qtp if
possible wht is the script.
7.example for lowlevelrecording

Answers were Sorted based on User's Feedback



This is Ajay i have few douts if anybody know pls give me reply. 1. i have opend 2 gmails i..

Answer / amarendra kothuru

1) i have opend 2 gmails i am working with 1 gmail i want
to close other gmail by usig script.
Ans: Use index property to uniquely indentify the Browser.
In QTP, for any object, Index starts from Zero. If only one
browser opened, Index value is Zero. For the second
browser, index value will be 1 and so on.
The below code will close the second Gmail brower if it two
or more Gmail Pages are opened. Otherwise It won't close.
If (Browser("title:=Gmail: Email from
Google","index:=1").Exist) Then
Browser("index:=1").Close
End If
If u want to close any broswer, use only index property in
Browser object




2) i have 10 links in a page all of them have same
properties& names i want to click on 5link by using script.
Ans: Use index property in descriptive programming so that
u can perform click action on 5th link.
i.e
For example, ABCD is the name of the link and page contains
10 links with the same name ABCD and you want to click on
5th, this case the below code work. Index starts from Zero.
So fifth link contains the index value 4.

Browser("title:=Gmail: Email from Google").Page
("name:=Gmail: Email from Google").Link
("name:=ABCD", "index:=4").Click



3).i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.
Ans: The below code that will verify whether the Item exist
in the combobox or not. i.e. the given city Hyderabad exist
in the CityList combobox or not.

CityName = "Hyderabad"
Result = 0
all_items = Browser("Cities").Page("Cities").WebList
("CityList").GetROProperty("all items")
For Each aitem In all_items
If aitem = CityName Then
Reporter.ReportEvent micPass "City is Found
in the List", "Passed"
Result = 1
Exit For
End If
Next
If Result = 0 Then
Reporter.ReportEvent micPass "City is Found in the
List", "Passed"
End If



4) size of objectrepository
Ans: The Size of the Object Repository might be the size of
the .tsr file in your script.


5) what r problems we get during writing the script
Ans: In general, you can get the following probles while
preparing the script
1. Sometimes you may not able to find/recognize the unique
property value of the object.
2. Synchromnization: this is one of the major issue while
preparing and executing the script.
3. If you have good Automation framework, then only it is
easier to prepare the scripts
4. It depends on your logic where you are going to
implement in the script




6) is it possible to compare to excel sheets in qtp if
possible wht is the script.
Ans: It is possible to verify two Excel sheets in QTP.
I can explain the Steps to prepare the script.
Step1: Import the first Excel sheet to Gloalsheet, Second
excel sheet into Local sheet
Step2: Get the rowcount of two Globalsheet and localsheet
Step3: Compare the rowcounts and columncounts of two sheets
if those are equal, verify each value of the cell.
If any one combination failed(verifying cell value,
Mention that two excel sheets are different
else
Two excel sheets are equal.
Else
Mention that two excel sheets are different




7) example for lowlevelrecording
Ans: I didnot work on Lowlevel recording, so I don't have
an idea.

Is This Answer Correct ?    4 Yes 2 No

This is Ajay i have few douts if anybody know pls give me reply. 1. i have opend 2 gmails i..

Answer / manas jena

litle bit modify of answer if u ur using browser object
then creation time property should user
1. 2 gmail opened
ans

Browser("title:=.*gmail.*" "creationtime:=1" ).close

The first opened browser creation time will be 0,next
opened browser creation time is 1.

See ordinal identifier in QTP

3. ans:

you can use

Index or location property

Index work on left to right and location works top to buttom

example

Text Box 1: Text Box 2:


Text Box 3: Text Box 4:

Text Box 1: location=0
Text Box 2: location=2
Text Box 3: location=1
Text Box 4: location=3

'Text Box 1
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest","location:=0").Set "1"

'Text Box 3
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest","location:=1").Set "2"

'Text Box 2
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest","location:=2").Set "3"

'Text Box 4
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest","location:=3").Set "4"
--------------------------------------------------
Text Box 1: index=0
Text Box 2: index=1
Text Box 3: index=2
Text Box 4: index=3


'Text Box 1
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest", "index:=0").Set "1"

'Text Box 2
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest", "index:=1").Set "2"

'Text Box 3
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest", "index:=2").Set "3"

'Text Box 4
Browser("title:=.*Descriptive.*").Page
("micclass:=Page").WebEdit
("name:=dpTest", "index:=3").Set "4"

Is This Answer Correct ?    1 Yes 0 No

This is Ajay i have few douts if anybody know pls give me reply. 1. i have opend 2 gmails i..

Answer / amarendra kothuru

Small change in Answer for third question

3).i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.
Ans: The below code that will verify whether the Item exist
in the combobox or not. i.e. the given city Hyderabad exist
in the CityList combobox or not.

CityName = "Hyderabad"
Result = 0
all_items = Browser("Cities").Page("Cities").WebList
("CityList").GetROProperty("all items")
For Each aitem In all_items
If aitem = CityName Then
Reporter.ReportEvent micPass, "City is
Found
in the List", "Passed"
Result = 1
Exit For
End If
Next
If Result = 0 Then
Reporter.ReportEvent micFail, "City is not Found in
the
List", "Failed"
End If

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More QTP Interview Questions

What is smart identification in QTP?

0 Answers   HCL,


Which environments does qtp support?

0 Answers  


what is QTP batch testing tool?

2 Answers  


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

0 Answers  


1) How will you associate SOR in Runtime? ( u had written 10 lines of code from 11th line u want associate what code u will write) 2) How will close n number of browser expect only one which is has to test? ( First tell me how will you identify how many browser are opened ) what logic u will use? 3) In web Table u want to click on link ( Link Name Mohamed ) you dont know in which row and column that link is there. how wil u identify and click on that link.

2 Answers  






where is the bitmap checkpoint be saved

3 Answers  


Q- what is the advantage of merging tool in QTP 9.2?

1 Answers   TCS,


can objects recogonised without repository?

10 Answers   AZTEC,


how to test background color and dynamic images during runtime

4 Answers   CTS,


when i perametarization of the test through outputcheckpoint,i have seen run time error i.e outputcheckpoint mismatch .Plz tell anybody to me(qtp).How to clear that?

1 Answers  


Cn u please clarify my doubt Where are micTab and micReturn used.Thanx in Advance

2 Answers  


What is object identification?

8 Answers   Wipro,






Categories