java - Selenium WebDriver click on input element to upload file freezes -
java - Selenium WebDriver click on input element to upload file freezes -
i have click on element upload csv file selenium webdriver in junit. input looks this:
<input type="file" name="upload0" size="56" value="" id="dateiimportschritt2csv_upload0"/>
if click on input element os window opens have take file upload. problem if utilize selenium clicking input this:
driver.findelement(by.xpath("//div[@id='wwctrl_dateiimportschritt2csv_upload0']/input")).click();
it open os window, freezes whole test without exceptions. if close window manually, test continues.
on place in code, have download file. similar, except it's not input element anchor element (<a>
) , works fine there.
so how click input element opens os window without freezing test? tried submit()
, window not open method.
i'm using: windows 7 firefox 32.0.3 selenium webdriver 2.43.1 junit 4
edit: whole div element looks this:
<div class="group " id="wwctrl_dateiimportschritt2csv_upload0"> <label id="label_dateiimportschritt2csv_upload0" for="dateiimportschritt2csv_upload0"> <span>csv-importdatei für ranglisten auswählen</span> </label> <p class="labelinfo" id="help_dateiimportschritt2csv_upload0"> bitte wählen sie eine für den import bestimmte datei aus. </p> <input type="file" name="upload0" size="56" value="" id="dateiimportschritt2csv_upload0"/> </div>
there no submit button. input not used typing, can click on open window.
driver.findelement(by.xpath("//div[@id='wwctrl_dateiimportschritt2csv_upload0']/input")).sendkeys("your path");
use works luck...
java selenium selenium-webdriver automated-tests
Comments
Post a Comment