[Webtest] input_type = file question

Marc Guillemot webtest@lists.canoo.com
Wed, 15 Oct 2003 18:13:22 +0200


Hi Dave,

afaik webtest <setinputfield> just supports text fields but as httpunit provides 
way to set a file input field, it would be possible to write a new test step. A 
nice challenge for a new user ;-)

Marc.

Dave Anderson wrote:
> Greetings!
> 
>  
> 
> I am a new user of the webtest tool and I have a question regarding the 
> input type field.
> 
>  
> 
> My OS is Solaris 2.8
> 
> My webtest build number is 365
> 
>  
> 
> The HTML section I am playing with is:
> 
>  
> 
> <input type=”file” name =”fileSource” value =”—“ size =”48” maxlength=”48”>
> 
>  
> 
>  
> 
> My webtest xml file looks like the following:
> 
>  
> 
> .
> 
> .
> 
> .
> 
> <setinputfield stepid=”Entering File Name”
> 
>                        name=”fileSource”
> 
>                        value=”/export/home/data/test_data/test.dat” />
> 
>  
> 
> .
> 
> .
> 
> .
> 
> <clickbutton  stepid=”Click Finish Button”
> 
>                       label=”Finish”
> 
>                       name=”operation” />
> 
>  
> 
> When I run the test here is what I receive:
> 
>  
> 
> BUILD FAILED
> 
> Test step clickbutton named “Click Finish Button” failed with message 
> “Illegal parameter fileSource in form [, post, 
> /task/ControlTaskingFormHandler, , , _top, , ] with message <Attempted 
> to assign to parameter ‘fileSource’ the extraneous value 
> ”/export/home/data/test_data/test.dat’.> “
> 
>              at 
> com.canoo.webtest.ant.TestSpecificationTask.stopBuildIfNeeded(testSpecificationTask.java:83)
> 
> .
> 
> .
> 
> .
> 
>  
> 
> I’ve looked through the example tests supplied and I haven’t found any 
> examples where the “file” input type is used. Has anyone successfully 
> integrated this type of  test into their environment?
> 
>  
> 
> Any help would be appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> Dave
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping 
> <http://shopping.yahoo.com/?__yltc=s%3A150000443%2Cd%3A22708228%2Cslk%3Atext%2Csec%3Amail> 
> - with improved product search