What about just the below?
@browser.file_field(:name => "original").when_present.set *my_image*
On Monday, April 15, 2013 11:07:40 AM UTC-4, Karoline Leite wrote:
>
> Hi !
>
> I'm trying to use an INPUT FILE, but I'm receiving error like "unable to
> locate {:name=>"original", :tag_name=>"input", :type=>"file"} "
>
> My page has an DIV with an FORM, and the FORM has an INPUT FILE element.
> The input file has an attribute "MULTIPLE"...
>
> I'm trying:
>
> *@browser.div(:class, "ui-dialog ui-widget ui-widget-content
> ui-corner-all ").form(:id, "file_upload").file_field(:name,
> "original").when_present.set my_image*
> *
> *
> This way, I can't find the element...
>
> I tried, just testing, the both codes and the STEP pass:
>
> *@browser.div(:class, "ui-dialog ui-widget ui-widget-content
> ui-corner-all ").when_present.click*
> *
> *
> *@browser.div(:class, "ui-dialog ui-widget ui-widget-content
> ui-corner-all ").form(:id, "file_upload").when_present.click*
> *
> *
> So, watir finds the DIV and the FORM, but can't find the input file... I'm
> thinking the problem is the attribute *multiple *
> *
> *
>
> How do I set this input file ?
>
>
> The page code:
>
> <div style="display: block; z-index: 1002; outline: 0px; height: auto;
>>> width: 500px; top: 144px; left: 426px;" class="ui-dialog ui-widget
>>> ui-widget-content ui-corner-all " tabindex="-1" role="dialog"
>>> aria-labelledby="ui-dialog-title-add_media_dialog"><div
>>> class="ui-dialog-titlebar ui-widget-header ui-corner-all
>>> ui-helper-clearfix"><span class="ui-dialog-title"
>>> id="ui-dialog-title-add_media_dialog"><span class="title">Adicionar
>>> imagens</span></span><a href="#" class="ui-dialog-titlebar-close
>>> ui-corner-all" role="button"><span class="ui-icon
>>> ui-icon-closethick">close</span></a></div><div id="add_media_dialog"
>>> style="display: block; width: auto; min-height: 114px; height: auto;"
>>> class="ui-dialog-content ui-widget-content">
>>
>> <div class="main upload-form clearfix" style="">
>>
>> <form action="/data_entry/imagens/upload"
>>> enctype="multipart/form-data" id="file_upload" method="post"
>>> class="file_upload"><div style="margin:0;padding:0;display:inline"><input
>>> name="authenticity_token" type="hidden"
>>> value="jyzTEwkkJt3MjDn7O5IS+EY1gmuayRiBpDtZXumS4TA="></div>
>>
>> *<input multiple="multiple" name="original" type="file">*
>>
>> <div class="dropzone">Arraste seus arquivos de imagem nesta área ou
>>> clique para escolher os arquivos</div>
>>
>> </form>
>>
>> <div id="files">
>>
>> <div class="uploaded"></div>
>>
>> <table class="to-upload">
>>
>> <tbody></tbody>
>>
>> </table>
>>
>> </div>
>>
>> </div>
>>
>> <div class="actions" style="">
>>
>> <button class="button default cancel" id="btn_file_upload_cancel">
>>
>> <span class="ico"></span>
>>
>> Cancelar
>>
>> </button>
>>
>> <button class="button default play file_upload_start"
>>> id="btn_file_upload_start">
>>
>> <span class="ico"></span>
>>
>> <span begin="Iniciar" class="text" continue="Continuar" pause="Pausar"
>>> pausing="Pausando...">Iniciar</span>
>>
>> </button>
>>
>> <button class="button default ok file_upload_next"
>>> id="btn_file_upload_done">
>>
>> <span class="ico"></span>
>>
>> Pronto
>>
>> </button>
>>
>> </div>
>>
>> </div></div>
>>
>>
>
> Thanks in advance!
> Karol
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.