これまで数時間この問題に取り組んできましたが、私はまだそれに固執しています。 HTMLコードのこの部分で分度器 - CSSでネストされた要素を取得できません
:分度器E2E試験について
<div class="container ng-scope">
<div class="fc-toolbar"></div>
<div class="fc-view-container" style="">
<div class="fc-view fc-agendaWeek-view fc-agenda-view">
<table>
<thead class="fc-head"></thead>
<tbody class="fc-body">
<tr>
<td class="fc-widget-content">
<div class="fc-day-grid"></div>
<hr class="fc-divider fc-widget-header">
<div class="fc-time-grid-container fc-scroller" style="height: 329px;">
<div class="fc-time-grid">
<div class="fc-bg"></div>
<div class="fc-slats">
<table>
<tbody>
<tr>
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"><span>00</span></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"></td>
<td class="fc-widget-content"></td>
</tr>
<tr>
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"><span>01</span></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"></td>
<td class="fc-widget-content"></td>
</tr>
<tr>
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"><span>02</span></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 44px;"></td>
<td class="fc-widget-content"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
、Iは、テーブル内の第2 tr
をキャッチしgetLocation()
を使用してその座標を取得しなければなりません。
これは私がTRをキャッチすることになってどのようである:
var secondRow = element(by.css('.fc-body tr .fc-time-grid-container.fc-scroller .fc-slats table tbody tr:nth-child(2)'));
そして、どのように私はその座標を取得することがあります。
secondRow.getLocation()
私は私が得た上記のコードを実行しようとするたび:
NoSuchElementError: No element found using locator: By.cssSelector(".fc-body tr .fc-time-grid-container.fc-scroller .fc-slats table tbody")
&のペースト.fc-body tr .fc-time-grid-container.fc-scroller .fc-slats table tbody
をブラウザのコンソールにコピーするとJQuery、それは2番目のtr
を正しく返します。
分度器で作業していない理由がわかりません。
iframeにテーブルがありますか?あなたはまだいくつかの睡眠を追加しようとしますか? – Buaban
テーブルはiframeではありません。上記のコードはfullcalendarから取得されています。追加すると問題は解決します。 – grimi
あなたはcss-selectorを使用している特定の理由はありますか? – RemcoW