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

When it be decided to go for either Per - Action or Shared?

2 Answers  


How can we record an edit box in the Web application ?

4 Answers   Kanbay,


How to create frame work for qtp?

1 Answers   Bank Of America, Polaris,


How to test results for qtp ?

0 Answers  


how to write code for to select all the checkboxs in the gmail i wrote code for my question but it didn't works any body suggest what wrong my code my code is Set chkboxDesc=Description.Create() chkboxDesc("type").value="chekbox" Set chboxcollection=Browser("name:=Gmail .*").Page("title:=Gmail .*").ChildObjects(chkboxDesc) For i=0 To chboxcollection.count-1 chboxcollection(i).set "ON" Next i was getting general run time error pls help me i am in learing stage

2 Answers  






What type of VB script u had done in expert view?

1 Answers   HCL,


Explain about Standard output value, Text output value, database o/p value, Xml O/p value, Xm o/p Value

1 Answers   TCS,


what is Property......End Property loop? how to write sript for it in QTP

0 Answers  


Suppose I want to use Index value of "WinEdit" in my script .But it is showing None in "Ordinal identifier" value of Testobject Details in the Object Repository.How to enable Ordinal Identifiers to capture the Index value of that particular WinEdit. I have selected "index" and clicked "OK" from Tools-> Object Identification Again I added same WinEdit to the Object repository But I did not get Index value..Please any one help me.How to enable Ordinal indentifiers

1 Answers  


Plz explain about MATCH/EXACT MATCH/IGNORE SPAGE in text check points?

1 Answers  


What kind of errors can b handled in QTP in real time scenario?

1 Answers  


Plz explain about object propeties in object identification? means.. explain about 1. mandatory properties.2. assestive properties 3. ordinal properties.

3 Answers   TCS,


Categories