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

For Passing Parameters from one Action to another Action we will use Input & Output parameters. Can any one tell how to use this Input & Output parameters with Example ?

2 Answers   TCS,


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

0 Answers   Value Labs,


dears, I have one question for QTP.If my software is english and defined objects is english name. But, if my software has support MUI, under this case that my objects in the QTP can't work, because the QTP can't catch the objects name. In this case, is anybody know how to solve this problem? Thanks a lot.

2 Answers   CyberLink,


what is difference betweem class annd object?

1 Answers  


what is run-time data?

0 Answers  






Am going to QTP testing......but i dont know coding languages like (c,c++,java,etc)and am not having interest in coding .............can i choose testing tools like qtp to learn and get a job in software......please reply me

1 Answers  


We have a dynamic webtable where rows keep on adding.I have to click on particular row where the status changes to Update or Save.How do you click on Status(either it can be Update or save)

2 Answers   IBM, Infosys,


I want to open a GOOGLE page without recording a test in QTP.Can any one answer me?

4 Answers   IBM,


what is a good testcase?

3 Answers   Wipro,


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

0 Answers   Ordain Solutions,


What is dictionary object? what is the use of it? How you will display all the items in the dictionary object?

1 Answers   Bank Of America,


Hi Suppose u have complex Test scripts which u vl write first and which u vl execute first

2 Answers   Symphony,


Categories