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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the new feature of UFT regarding the export of test results?

575


How to get popup error message.

1025


How do I get the QTP scripts result in xml format by using vb script function?

1780


Pls can anyone give me the entire code for the Keyword driven framework with respect to he Flight Reservation Window in detail with explanation. Pls explain in detail stepwise. Thanks a lot. Pls very urgent?.

1517


I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2

1494






Explain different types of action in qtp?

570


How did you use regular expressions in QTP and also in WR?

2159


How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?

562


i am a begnner so am learning Error handling :tried using Recovery manager didnt work i want to be able to handle errors , e.g. if while running the test the folwoing does not show up then how can i use the If then else and goto next step in the test, as in many scenarios it does not show up Browser("The Shopping Channel -").Page("The Shopping Channel -_8").Image("easy pay").Click

1461


I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.

1719


What is the use of running the scripts in Hidden-mode in UFT?

680


how can we preform retesting(DATA driven test) using function please gine the code for loginpage

2271


How many number of actions possible in qtp?

600


explain abt dyanamic changing object with example?

1899


how will you load the test cases in ddt?

1593