functional testing file uploads

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

functional testing file uploads

Robert Fletcher
Is there any way to upload a file in a functional test? I'm drawing a blank.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: functional testing file uploads

Dierk König
In case you use webtest for functional testing:
http://webtest.canoo.com/webtest/manual/setFileField.html

cheers
Dierk

Am 20.07.2009 um 10:06 schrieb Robert Fletcher:

> Is there any way to upload a file in a functional test? I'm drawing  
> a blank.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: functional testing file uploads

Robert Fletcher
I'm using g-func, but they're both HTMLUnit based so I'm sure I can
dig in the webtest code and make something work. Thanks.

On Mon, Jul 20, 2009 at 9:55 AM, Dierk König<[hidden email]> wrote:

> In case you use webtest for functional testing:
> http://webtest.canoo.com/webtest/manual/setFileField.html
>
> cheers
> Dierk
>
> Am 20.07.2009 um 10:06 schrieb Robert Fletcher:
>
>> Is there any way to upload a file in a functional test? I'm drawing a
>> blank.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: functional testing file uploads

Robert Fletcher
In case anyone is interested I got it working. It seems you can't set
a file input inside a form block like you can set other inputs. What I
had to do was:

                byId("file").valueAttribute = testFile.absolutePath
                form {
                        click "Create"
                }

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email