In my web application there are 5 buttons in the page which having the same title, name and the id is getting generated randomly, How to click on the particular button,which properties can i use, so thats its work fine in IE.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Selenium will be able to locate the element using various methods –
1. id,
2. name,
3. xpath,
4. css id.
The best practice would be to add a name to that element and then let the id be generated randomly. You can then identify the element by name(if you are using selenium plugin for firefox, record a test case and go to that element and the plugin will give you options to chose another identifier if you wish to). But in most cases of dynamic web pages, selenium starts looking for the element even before it’s generated or loaded. The trick is to ask selenium to wait till the element/page is loaded completely. You can use waitForElementPresent() method. This method will solve 90% of your problems