次のHTMLは、Facebookのイベント作成ダイアログの一部です。私は時間フィールドを値9にしようとしていて、StackExchangeで他の人のアドバイスを参考にしてさまざまな組み合わせを試みました。この1は私を持っている:Selenium IDEを使用してdiv/input/spanの組み合わせを識別して操作する
<div class="_4nxi" dir="ltr">
<div class="_4nx7 _4nww _5pw0">
<div class="_4nwx">
<label style="background-color: transparent;" class="_4nx3 _5pw6" for="js_9" aria-hidden="true">7</label>
<input style="background-color: rgb(255, 255, 255);" id="js_9" class="_4nx5" aria-label="hours" aria-valuetext="7" role="spinbutton">
</div>
</div><span class="_4nxh _5pwa" aria-hidden="true">:</span>
<div class="_4nxe _4nww _5pw0">
<div class="_4nwx">
<label class="_4nx3 _5pw6" for="js_a" aria-hidden="true">30</label>
<input id="js_a" class="_4nx5" aria-label="minutes" aria-valuetext="30" role="spinbutton">
</div>
</div>
<div class="_4nxa _4nww _5pw0">
<div class="_4nwx">
<label class="_4nx3 _5pw6" for="js_b" aria-hidden="true">AM</label>
<input id="js_b" class="_4nx5" aria-label="meridiem" aria-valuetext="AM" role="spinbutton">
</div>
</div>
</div>
を私は入力(ID = js_9)とは思わない、すなわち「スピンボタン」として、他の目的に使用しているように見える、操作するためのフィールドです。私はそれを試みた。 値がクリックされると外側のdivのIDが動的に変化するので、私はそれを使用しないようにしようとしています(上には含めていません)。
私はtype
とsendKeys
とtypeKeys
を使用しようとしましたが、私は、正しいコマンドとさまざまなdivタグ/入力とスパンを持っていないの組み合わせは、私は解決策をしないのです意味だと思います。アクションを記録することは、相互作用を示さない。提案は高く評価されました。
私は次のことを試してみました:
typeKeys|//div[@class='_4nx7 _4nww _5pw0 _5pw1']|9
click|//div[@class='_4nx7 _4nww _5pw0 _5pw1']
と
typeKeys|//label[@class='_4nx3 _5pw6']|9
click|//label[@class='_4nx3 _5pw6']
と
typeKeys|id=js_9|9
click|id=js_9
と
sendKeys|//div[@class='_4nwx']|9
また、facebookイベントの作成にSelenium IDEを使用する必要がありますか?なぜあなたはそれをやっていますか? – Antesser