This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Originally posted by Micky Morgan: I was trying to use //input[@title='Expand Folder'] and it always points to the first input tag...
Actually it returns a list that contains both of the input elements. Presumably you are then applying something that selects the first entry from the list.
Could any one help me writing the Xpath expression that gets the second input tag...
And then you want to choose the second entry in that list you already have, so do that: //input[@title='Expand Folder'][2]
Micky Morgan
Greenhorn
Joined: Sep 20, 2006
Posts: 19
posted
0
Thanks for the prompt response..but unfortunately none of the optios working..
I am actually clicking (thru automation) the image whether it opens or not.. for that I am using syntax like this...
I don't understand this "clicking" and "automation" business, except when you say "image" it makes me suspect you really want to get the src attribute from that element. And it would help if the example you had posted were well-formed XML. The fact that isn't implies that we aren't looking at the real data and so we are working in the dark.
However I still say the answer is
//input[@title='Expand Folder'][2]
or perhaps
(//input[@title='Expand Folder'])[2]
Micky Morgan
Greenhorn
Joined: Sep 20, 2006
Posts: 19
posted
0
Thanks to Purushothaman and Paul for prompt responses...
The reason why the above expresions ( //table/input[1] ) did not work because ... table is not immediate parent of input tag as can be seen above...
So the correct XPtah expression that worked for me is..//table/th[2]/input[@title='Expand Folder']
or
//th[2]/input[@title='Expand Folder']
Thanks again for the help...
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Xpath expression to locate second input tag...