Question

I looked around, but I wasn't able to find anything that answered the question that I have at hand. I want to click a button with Selenium, but the button ID is dynamic (meaning it changes after EACH button press). I would like to click the button via it's value, but with Selenium IDE, the Firefox extension, I'm not positive how I could go about this. Here's the coding of the button that I'm trying to click, with Selenium.

<input id="move247957048" type="button" style="width: 120px" value="Sacred Sword">

The input id="move" that you see, it changes every single time I click this button. All of it changes except for the first digit, the 2. With Selenium, I have no clue whatsoever about how I could click this button via it's value, or whatever would work. D: It's repetitive as well, so it'd handle it multiple times.

Was it helpful?

Solution

In Selenium IDE you can use xpath defined locators, in your case I would use next xpath //input[@value='Sacred Sword']. You can find it in related documentation http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#test-case-pane enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top