<input type="submit" id="button" value="Edit"/>
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/8VCiKnEYTRAJ.
For more options, visit https://groups.google.com/groups/opt_out.
<input type="submit" id="button" value="Edit"/>
<input type="submit" id="button" value="Edit"/>
<input type="submit" id="button" value="Edit"/>
I have same edit button,but under different forms.I tried to click the button in numersous ways as follows
selenium.click("xpath=//input[@id='button' and @value='Edit']");
selenium.click("xpath=//input[@id='button'][1]");
selenium.click("xpath=//input[@id='button' and @value='Edit'][1]");
Nothing is worrying.Can anyone help me automate this.Thanks in advance
You have found a bug, report it and get the devs to fix it.
If they refuse to fix it they suck, the whole codebase will likely suck, the project most likely sucks too.
Life’s too short to work with teams that suck. Your will find work much more enjoyable when you work with an awesome team!
The correct syntax for finding the n’th item with an identical XPath on the page is “xpath=(...path...)[n]”, for example “xpath=(//input[@id='button' and @value='Edit'])[2]” for the second button with both the id “button” and the value “Edit”. Note the placement of the parentheses – that’s the key – and the fact that in XPath, the first item is numbered “1” (not “0” as some programmers expect).
Ross
Really, don’t even bother trying to automate bugs.
If there is a bug in the code the test should fail, if you automate around it, it’s quite likely the bug will not get fixed.
If you go around “fixing” your tests so that they pass when legitimate problems are found you are not testing you are wasting your time. Your test suite is now worthless because it is not catching errors and people will quite legitimately run your suite in the future and assume everything is fine when the test passes.
DO NOT AUTOMATE AROUND BUGS TO MAKE YOUR TEST PASS!
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Randy Harding
Sent: 31 October 2012 00:59
To: seleniu...@googlegroups.com
Subject: [selenium-users] Re: Multiple buttons with same name and id
Selenium can usually find the elements, so something else may be wrong. Do you need to call a function related to switch_to locate the elements? Can you create a test case in the IDE, export it, and then post it here? Then we can see the basic framework for what you need to do including any switch_to statements. Let us know instructions on the IDE and test case I am referring to
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/l92wJ7w75DcJ.