How to Hover over and click on an invisible element using selenium webdriver?

前端 未结 6 2013
自闭症患者
自闭症患者 2021-02-02 17:43

There is an invisible element on my HTML page which becomes visible when a mouse hover is done on the element. What I Have to do is

  1. Hover over the element
  2. <
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 18:26

    using javascript executor like

    ((JavascriptExecutor) webdriver).executeScript("document.getElementById('btn').click();");
    

提交回复
热议问题