Clear date input fails on chromewebdriver

前端 未结 5 1673
太阳男子
太阳男子 2021-01-01 22:50

I ran into a problem while switching from firefoxdriver to chromedriver with selenium, it was working fine in FF but now when I try to clear a date input field I have this e

5条回答
  •  囚心锁ツ
    2021-01-01 23:38

    Sometimes you can change the xpath a bit and get to the point that it works:

    For example for this piece of DOM:

    if you use:

    wait.until(ExpectedConditions.visibilityOfElementLocated(By
                        .xpath("//tr[@class='table-filters']//td"))).clear();
    

    it will not work, but:

    wait.until(ExpectedConditions.visibilityOfElementLocated(By
                        .xpath("//tr[@class='table-filters']//td//input"))).clear();
    

    Works.

提交回复
热议问题