Search code examples
javahtmlseleniumclickmarquee

How to click marquee in Selenium?


I have an application where my list of upcoming vessels are running in marquee. How to click the required data using Selenium with Java. Please help if there is any alternative solution.


Solution

  • You could use:

    getDriver().findElement(By.tagName("marquee")).click(); // click element
    getDriver().findElement(By.tagName("marquee")).getText(); //read value
    

    But the marquee tag is deprecated years ago, and in any of the next browsers versions wont work, so i would change it for another feature.

    https://developer.mozilla.org/en/docs/Web/HTML/Element/marquee