1

Selenium を使用して、ページ上の Telerik RadAsyncUpload コントロールでファイルのアップロードを自動化しようとしています。私の環境は: MAC、chrome+FireFox
RadAsyncUpload コントロールからファイル選択ダイアログ ボックスを開く方法がわかりません。コントロールは次のようになります。
ここに画像の説明を入力

コントロールには、次の html 構造があります。

<div id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImage" class="RadAsyncUpload RadUpload RadUpload_Default" style="width:240px;">
        <input id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImage_ClientState" name="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImage_ClientState" type="hidden" autocomplete="off">
    <ul class="ruInputs" id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImageListContainer">
<li id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagerow0"><span class="ruFileWrap ruStyled">
<input type="text" tabindex="-1" class="ruFakeInput radPreventDecorate" id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefakeInput0" size="22">
<label for="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefakeInput0" style="display:none">label</label>
<input type="button" tabindex="-1" value="Upload screenshot/document" class="ruButton ruBrowse">
<input type="file" tabindex="0" class="ruFileInput" name="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefile0" id="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefile0" size="23">
<label for="ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefile0" style="display:none">label</label></span><div class="ruDropZone"><span>Drop files here</span></div></li></ul></div>

ファイルのアップロード ダイアログ ボックスを開くには、次の操作を実行してみました。

driver.findElement(By.id("ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImagefile0")).click();

また

driver.findElement(By.id("ctl00_cphBody_wzAddItem_rptItems_ctl00_rdauImage")).click(); //Added event listener breakpoint on Mouse->Click and saw the parent <div> being highlighted.

これらのオプションのいずれも、ファイル アップロード ダイアログ ボックスを開きませんでした。javascriptを使用してコントロール内のファイル入力をクリックしようとしましたが、それもうまくいきませんでした。

ファイル選択ダイアログをトリガーするための何か/他の解決策が欠けているかどうか、誰かが提案できますか?

4

0 に答える 0