Selenium Webdriver - click on hidden elements

前端 未结 5 1353
自闭症患者
自闭症患者 2020-11-27 16:58

I am trying to automate upload file functionality in Google Drive.

The element used to pass parameters is hidden with height - 0px.

None of the user actions

5条回答
  •  迷失自我
    2020-11-27 17:55

    Simple solution:

    WebElement tmpElement = driver.finElement(ElementLocator);
    JavascriptExecutor executor = (JavascriptExecutor)driver;
    executor.executeScript("arguments[0].click();", tmpElement);
    

提交回复
热议问题