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

what is the syntax for regular expression in QTP? how to create user defined functions in QTP?

6 Answers   CTS, MBT, TCS,


Explain the concept of object repository & how QTP recognises objects?

1 Answers  


how u conduct GUI testing and PERFORMANCE testing on MS- WORD? and What r the GUI Test Cases and performance Test Cases?

3 Answers   Accenture, Civil Service, ICICI, Jintek, Satyam, Singularity, Syntel, TCS, Wipro,


I have a Webtable object in my shared object repository, say WT1, which has different index value in 2 different versions, one version having WT1's index value as 1 and other version having WT1's index value as 2. how could i use same test script to identify the WT1 object having different index values.

5 Answers  


take one example and write vbscript on one web application in qtp? explian descriptive programe with one example?

2 Answers   IBM,






How we can add actions in the test using QTP?

2 Answers  


In the Hybrid framework, data can access the database, excel file, XML etc. Is it true?

0 Answers  


what type of frame work used in your company?

2 Answers   HCL,


tell me about regular expressions in QTP? where we use? give eample?

2 Answers   IBM,


Could you please any body help me.for example in web table in the first row and first column there are 3 links like l1,l2,l3 having indexes 0,1,2 but second time links will change their order like l2,l3,l1 and indexes also changed how can we handle this situvation with script....

2 Answers  


What is Terminal Emulators”? Why we used in QTP.? How he works on QTP.

1 Answers  


How to give Table check points?

4 Answers   ssinformatics,


Categories