Hello All,
Previously I was working on a Web Application. In that application, in some pages there were more than 1 WebButtons present having the same name, say for example "Save".
On that case, I was using both the "name" and "index" property like
QTP used to search all the WebButtons having name "Save" and then from the list of the found WebButtons, it was clicking the WebButton whose index was 0.
Now I am working on a Java Application. In this application, in a window, there are two JavaButtons with two different "Tagname", say "Button1" and "Button2"
When I am using the below code, it is saying that "there are more than one objects satisfying the criteria" (not exactelly the same warning, but conveys the same message)
Tagname property for both the buttons has different value, so it should get identified easily (If we look on Web App perspective)
When I am using the following code, the buttons are getting identified
So my point is here, is there any way of identifying the JavaButtons which are unique by its tagname or label in a particular window without using "index" property ?
I mean how do you guys do this ?
Previously I was working on a Web Application. In that application, in some pages there were more than 1 WebButtons present having the same name, say for example "Save".
On that case, I was using both the "name" and "index" property like
Quote:Browser("").Page("").WebButton("name:=Save","index:=0").Click
QTP used to search all the WebButtons having name "Save" and then from the list of the found WebButtons, it was clicking the WebButton whose index was 0.
Now I am working on a Java Application. In this application, in a window, there are two JavaButtons with two different "Tagname", say "Button1" and "Button2"
When I am using the below code, it is saying that "there are more than one objects satisfying the criteria" (not exactelly the same warning, but conveys the same message)
Quote:JavaWindow("").JavaButton("tagname:=Button1").Click
JavaWindow("").JavaButton("tagname:=Button2").Click
Tagname property for both the buttons has different value, so it should get identified easily (If we look on Web App perspective)
When I am using the following code, the buttons are getting identified
Quote:JavaWindow("").JavaButton("tagname:=Button1","index:=0").Click
JavaWindow("").JavaButton("tagname:=Button2","index:=1).Click
So my point is here, is there any way of identifying the JavaButtons which are unique by its tagname or label in a particular window without using "index" property ?
I mean how do you guys do this ?