org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view when trying to click a button

前端 未结 3 1061
离开以前
离开以前 2020-11-28 16:55

I\'m working with gecko driver selenium java with FF 60.0. Previously my code was working properly, but all of sudden, now every time I run it, it gives me an error as

3条回答
  •  佛祖请我去吃肉
    2020-11-28 17:15

    Try to use javascriptexecutor as shown sample code below,

    JavascriptExecutor je = (JavascriptExecutor) driver;
    je.executeScript("arguments[0].scrollIntoView(true);",driver.findElement(By.xpath("//a[@href='/admin/worker-summary']")));
    

提交回复
热议问题