how to click on object?
(with out knowing the object details)
for ex: in a webpage one link is available.i want to click
that link by using one menthod through qtp?

Answers were Sorted based on User's Feedback



how to click on object? (with out knowing the object details) for ex: in a webpage one link is ava..

Answer / ashok kumar

by using static DP:

Browser("micclass:=Browser").Page("micclass:=page").Link("micclass:=Link").click

by using dynamic DP:

Set objlink = Description.Create()
objlink("micclass").value = "Link"
Set link1 =
Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(objlink)
msgbox link1.count

Is This Answer Correct ?    6 Yes 4 No

how to click on object? (with out knowing the object details) for ex: in a webpage one link is ava..

Answer / vikrant

To identify any object you should know the properties of
that particular object.QTP has provided object spy tool to
identify the object.
By clicking on that icon it will allow you to view the
properties of that object then you need unique property
values of that object.

Is This Answer Correct ?    1 Yes 2 No

how to click on object? (with out knowing the object details) for ex: in a webpage one link is ava..

Answer / uday

Use the index of the link.

Say if it is 10th link in the web page, use index=9.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

How do you script a nested loop in QTP? I am showing a snipet of my code. Any suggestions to help me get this to work would be great appreciated! STEP A - Customer Number: No loop - ISBN: Loop STEP B - Customer Number: Loop - ISBN: Nested Loop Here is the code I am using now. I am using i for the loop and j for the nested loop in STEP B of my script. =========================================== 'CREATE AN ADDITIONAL CUSTOMER Dim myNum, RowNum, RowCnt2, val2, total, i DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" RowCnt2 = DataTable.GetRowCount i = 1 DataTable.SetCurrentRow(i) ' Set row to one Do while Not i > RowCnt2 i=i+1 DataTable.SetNextRow MsgBox Datatable.Value("Customer_Num") Msgbox i Msgbox RowCnt2 If Not i > RowCnt2 then val2=datatable.Value("Customer_Num","Global") OracleFormWindow("Sales Order").SelectMenu "File->New" OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").Enter val2 End If 'CREATE SECOND ISBN LIST DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" Dim j, RowCnt3, val3 RowCnt3 = DataTable.GetRowCount For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) ' datatable.getSheet("DataTable").setNextRow If Trim(DataTable("ISBN",dtGlobalSheet)) = "" Then j = j - 1 Exit For End If Next 'Define ISBN rows If RowCnt3 <> j Then RowCnt3 = j End If 'Loop through ISBN rows For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) val3 = Datatable.Value("ISBN","Global") msgbox j If j = 1 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").Enter val3 else If j < 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).Enter val3 else If RowCnt1 => 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").InvokeSoftkey "DOWN" OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").Enter val3 end if end if End If Next 'EXIT APP msgbox i loop Browser("Browser").Page("Oracle Applications 11i").Sync Browser("Browser").Close ========================================== It isn't working correctly in my nested loop in STEP B (for ISBN). Any ideas?? Thanks! SBsteve

0 Answers  


What is the extension of the qtp local repository?

0 Answers  


Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am not using TD or QC.Thx

5 Answers  


In qtp, how you can get the last character from a string?

0 Answers  


what is Unicode Compatibility ? HOw does this makes a diffrence from Winrunner.?

2 Answers  






I have a tool for automation testing (eg:qtp).I have two functionality(A & B) to test.A is tested once in a year. B is tested everyday. At present i have the money and resource availability to automate only one functionality.Which one will u suggest and why?

2 Answers   TCS,


Explain quicktest professional testing process?

0 Answers  


What is smart identification?

2 Answers   Ordain Solutions,


To count the no of links present in the yahoo home page i have written the script like this Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile ("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo! India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing While running the script it showing error that object "yahoo"isnot found in the object repository. Is there any setting before running the script? if yes what is the steps for it.Im using QTP9.0

2 Answers  


Hi, How to invoke QTP or any application through Command Prompt without using Vb script and batch file.... Reply me Srinivas

3 Answers   Excel,


Batch testing in howmany ways u perfrom in QTP

3 Answers   Lehman Brothers,


What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz

0 Answers   Livetek,


Categories