I have 5 save buttons in my application on 5 different tabs one after the another . I have spy them and added each of them in my OR. My Or is able to highlight each button on each of the 5 tabs. But when I run the script it does not click the object.Is there anything I have to edit in OR. Any property to add or delete?

Below are the properties of 5 save buttons. My code for each is like browser().page().savebutton1.click
Browser().page.savebutton2.click


Properties of 5 buttons
Dhopare, Namita
Sent: September 2, 2015 2:57 PM
To:
Vullengala, Jagadeeshchandra
"Class Name:=WebButton",
"abs_x:=718",
"abs_y:=693",
"class:=Button",
"disabled:=0",
"height:=22",
"html id:=btnSaveTab1",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"name:=Save",
"outerhtml:=<input id=""btnSaveTab1"" class=""Button"" onclick=""document.getElementById('a1').click();"" name=""btnSaveTab1"" value=""Save"" type=""button"">",
"outertext:=",
"type:=button",
"value:=Save",
"visible:=True",
"width:=41",
"x:=718",
"y:=616"


"Class Name:=WebButton",
"abs_x:=687",
"abs_y:=571",
"class:=Button",
"disabled:=0",
"height:=22",
"html id:=btnSave",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"name:=Save",
"outerhtml:=<input id=""btnSave"" class=""Button"" onclick=""document.getElementById('a2').click();"" value=""Save"" type=""button"">",
"outertext:=",
"type:=button",
"value:=Save",
"visible:=True",
"width:=40",
"x:=687",
"y:=494"

"Class Name:=WebButton",
"abs_x:=635",
"abs_y:=478",
"class:=Button",
"disabled:=0",
"height:=23",
"html id:=",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"name:=Save",
"outerhtml:=<input class=""Button"" onclick=""document.getElementById('a3').click();"" value=""Save"" type=""button"">",
"outertext:=",
"type:=button",
"value:=Save",
"visible:=True",
"width:=41",
"x:=635",
"y:=401"

"Class Name:=WebButton",
"abs_x:=695",
"abs_y:=558",
"class:=Button",
"disabled:=0",
"height:=22",
"html id:=BtnExternalPartySve",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"name:=Save",
"outerhtml:=<input id=""BtnExternalPartySve"" class=""Button"" onclick=""document.getElementById('a4').click();"" value=""Save"" type=""button"">",
"outertext:=",
"type:=button",
"value:=Save",
"visible:=True",
"width:=41",
"x:=695",
"y:=481"

"Class Name:=WebButton",
"abs_x:=672",
"abs_y:=642",
"class:=Button",
"disabled:=0",
"height:=22",
"html id:=",
"html tag:=INPUT",
"innerhtml:=",
"innertext:=",
"name:=Save",
"outerhtml:=<input class=""Button"" onclick=""document.getElementById('a5').click();"" value=""Save"" type=""button"">",
"outertext:=",
"type:=button",
"value:=Save",
"visible:=True",
"width:=40",
"x:=672",
"y:=565"




Previous Item Next Item
Connected to Microsoft Exchange



I have 5 save buttons in my application on 5 different tabs one after the another . I have spy them ..

Answer / bradan

'I may be failing to understand you right but according to what you have paste i can see that "html id" is unique on some of the properties.
'Note:
'1. Your properties to me look strange as "name" property is the same through all
'2. "Html id" is unique but on other 2 properties that you have paste we don't have the value for htlm id
'3. I have created the following solution based on the properties that are with html id according to your problem

' I'll suggest you to try the following;

Set objButtonClick=description.Create
objButtonClick("micclass").Value="WebButton"
Set objSearch=Browser("creationtime:=0").Page("Title:=.*").ChildObjects(objButtonClick)
'Let's see how many button are in the current browser open
MsgBox objSearch.count
'Please remove the msgbox line if everything is fine
For i=1 To objSearch.Count -1
'I usually use "name" inside GetROProperty method but on your case i'll use "html id" as it the one that is unique
results=trim(objSearch(i).GetROProperty("html id"))
' "btnSaveTab1" is optional
If instr(results,"btnSaveTab1")<>0 Then
objSearch(i).Click
Exit For
End If
Next

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

How to get Links count in an web application,without descriptive programming?

8 Answers  


how to write xml output check point bu useing descriptive programing .means without useing output check point

0 Answers  


In QTP for .net application which plug in is used? For Java Application which plug in is used ?

2 Answers   AppLabs, Fraze Tech,


how quick test record on dynamically generated urls and web pages.

3 Answers   Infosys, Satyam,


Explain the features and benefits of quick test pro(qtp)?

0 Answers  






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 are the features supported by UFT?

0 Answers  


abt filter function if iam using below two statments its ok My = Array ("Apples","Oranges", "Apricots") MyResult = Filter(My, "Oran") if i use msgbox MyResult it shows type mismatch plz help me

2 Answers  


How is the Bitmap checkpoint different from Image checkpoint?

0 Answers  


in how many ways you perform batchtesting?

2 Answers   Sapient,


Hi Friends, Can any one answer this question? 17) What method is used to retrieve the number of columns in the query results? A. Fields.Count B. Fields.Item(EOF) C. Fields.Count(BOF) D. Fields.Count.Value

2 Answers  


How to record application running on the Virtual machine?

0 Answers  


Categories