編集cが表示されている - 今、私は(2016年1月)の月を指定したい[OK]を、私はカレンダーサイクルは#
< September 2016 >
以下のように構成されていると、それは、右矢印をクリックして持っている2016年1月まで
を表示されます今要素は以下のように構成され
<div class="calendar">
<h3 id="calendar-month" class="calendar-title" title="September 2016"
role="heading" aria-live="assertive" aria-atomic="true">September 2016</h3>
<table class="calendar-grid" role="grid" aria-labelledby="calendar-month">
public static void MonthOut(string month)
{
var nextMnthOutBtn = DriverContext.Driver.FindElement(By.XPath(".//*[@title='Go to the next month']"));
var calMonth = DriverContext.Driver.FindElement(By.ClassName("calendar"));
IList<IWebElement> allValidDates = calMonth.FindElements(By.Id("calendar-month"));
foreach (var date in allValidDates)
if (date.Text.Equals(month))
{
break;
}
}
何ヶ月をデフォルトとして表示しますか? –
デフォルトの月は現在の月です。だから、1月を指定するのは難しいです。それはページに行く。現在表示されている月を無視し(指定したものと一致しない限り)、1月が表示されるまで次の月の矢印をクリックして停止します –