verifyElementPresent not working consistently

I’m trying detect a “play/pause” button in a loop. The same absolute xpath refers to both play and pause, but I can use relative xpath=// or css= to select the element by class. Selenium often misses the elements when I use the selectors. I can find the elements from the Selenium IDE, and the macro works once, sometimes twice in a loop. Since either the play or the pause will be present, I check for both. Neither is seen. I’ve used both xpath and css selectors. css works better, marginally.

Any help will be appreciated.

Sometimes using selectors such as //button[text()='Pause'] work better. Can you post the URL?

I think I found part of the problem. The button was changing states as I was checking it, I sometimes caught it, sometimes didn’t