【发布时间】:2021-11-17 05:15:59
【问题描述】:
此日历的日期范围为距当前日期 11 天,我如何检查通过脚本输入的日期是否在此范围内,如果脚本中提到的输入日期不在该日期范围内,则选择它否则那么应该点击当前日期。
有一个类可以用来获取当前日期(class="owl-dt-calendar-cell-content owl-dt-calendar-cell-today")calendar
public void selectRequiredOn(String date)
{
requiredOnClick.click();
currentDate.getText();
if(currentDate.equals(date))
{
currentDate.click();
}
【问题讨论】:
-
这个问题你不是昨天还是前几天才问的?是不是删了再问?抱歉,我不了解 Selenium,所以不懂问题,无法回答。