Geert Lemmens a écrit :
Hi,
I'm only working with Selenium for a couple of months so I'm new at it.
On our project, we are not using the driven mode for Selenium since we are
working with functional testers who don't have enough technical knowledge to
write Java.
Till now all worked well but now we have a problem when using Xpath-functions
on one screen. The situation is as follows: in our application we get a table
with a number of rows. At the end of each row, there is a checkbox in order to
select the rows you will be using in the next step.
You would get something like this (only a small abstract):
1/2003
01/01/2003 Payment Payed 'checkbox'
01/02/2003 Payment Not Payed 'checkbox'
01/01/2003 Payment Payed 'checkbox'
As you can see, row 1 and 3 are identical (also, each checkbox has the same
ID). We want to check the third line (so the second identical row). We can
select the second identical row if we work within the xpath expression with
rows and columns BUT these rows are generated with batches so often new lines
are added to the screen which makes it impossible to use this method.
Does anybody have other ideas how to solve this?
Html Text would be better to give a precise answer.
I would say that if you got the xpath which gives you the two lines,
just enclose it in parenthesis and add a [2] at the end.
For example if
//td[text()="01/01/2003"]/following-sibling::td[text()="Payment"]/following-sibling::td[text()="Payed"]/following-sibling::td/input
is the xpath that gives you both lines, you should write
(//td[text()="01/01/2003"]/following-sibling::td[text()="Payment"]/following-sibling::td[text()="Payed"]/following-sibling::td/input)[2]
to have the second line.
Hope it helps
Alex.
Ce message est protégé par les règles relatives au secret des correspondances.
Il est donc établi à destination exclusive de son destinataire. Celui-ci peut
donc contenir des informations confidentielles. La divulgation de ces
informations est à ce titre rigoureusement interdite. Si vous avez reçu ce
message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail
figure ci-dessus et de détruire le message ainsi que toute pièce jointe.
This message is protected by the secrecy of correspondence rules. Therefore,
this message is intended solely for the attention of the addressee. This
message may contain privileged or confidential information, as such the
disclosure of these informations is strictly forbidden. If, by mistake, you
have received this message, please return this message to the addressser whose
e-mail address is written above and destroy this message and all files attached.
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users