Uploading a file during a webtest

I'm trying to create a webtest that at some points uploads various types of files (image, audio....).  When I replay the webtest, at the point where its to upload the file I get an error....

Request failed: Could not find file '............\My Documents\Visual Studio 2005\Projects\SQL2005 Load Test\TestResults\directory\Out\testimage.jpg'

But the file testimage.jpg does not exist in that directory cause the directory is created at the time of the webtest being run.  Is there something that I'm missing here that's telling the webtest to look for the files in the newly created directory rather than the original directory that the file was recorded from



Answer this question

Uploading a file during a webtest

  • Ovaisakhter

    Yup that seems to have fixed the problem.....thanks

     

    One other question for you.......I'm trying to hit a page for testing that contains some Active X controls on it....now currently my IE browswer is set to allow all Active X controlls to run, but when I run my test in Visual Studio, it tells me that "my security setting do not allow web sites to use ActiveX Controls installed on my computer".  Is there another set of security setting in VS that I just can't find   I was under the impression that VS uses the currently security settings of IE.


  • Brian_n

    so how would I go about adding the activeX controll as a dependent request
  • Jason Firkin

    I've tried adding the activex as a dependant request.  However that doesn't see to work......I've found out that the file is a .cab/zip with the dll and a file for installing it as an activex.......so I'm assuming that the test suite isn't installing the activex or isn't capable of performing this action.
  • adangelo

    Mark Hollman wrote:

    I'm trying to create a webtest that at some points uploads various types of files (image, audio....). When I replay the webtest, at the point where its to upload the file I get an error....

    Request failed: Could not find file '............\My Documents\Visual Studio 2005\Projects\SQL2005 Load Test\TestResults\directory\Out\testimage.jpg'

    But the file testimage.jpg does not exist in that directory cause the directory is created at the time of the webtest being run. Is there something that I'm missing here that's telling the webtest to look for the files in the newly created directory rather than the original directory that the file was recorded from

    When I provide the file name, system is showing error message that file can not be found for uploading. System is looking the path at TestResult/MachineName dynamic directory for the file name. Even if I provide the full path for the file to upload, system is showing error message as Invalid ViewState.

    I got the error message when I left the file name as blank. When I deleted the "File Upload Parameter" from the form, system is showing me ViewState error on the page when I run the webtest.

    How can we force system to look particular path for upload file or how can we replace this " file upload parameter" with similar objects or how can we get rid of this viewstate error. I got this object by recording the web actions.

    Thank you in advance.

    Tampali


  • M_C

    Since web tests work at the HTTP level not the browser level, activeX controls aren't loaded by the web test engine.  For this reason, we disable activeX controls and javascript in the web test result viewer, also.  Keep in mind you can add requests an ActiveX control would issue to your web test or add the activeX control itself as a dependent request and the simulated load will match what a browser would do.

     

    Josh



  • iits Stefan

    Grab the ActiveX control's URL out of the web page, right click the page's request in your web test, select Add Dependent Request, select that new dependent request, go to the Properties window, and paste in the ActiveX control's URL.

    Josh



  • SGirase

    Mark,

    If you are only running the tests locally, not on a controller/agent rig, you can just put the full path to the file in the file upload parameter.  If that's not an option, you'll need to add the file to upload as a deployment file in your solution's .testrunconfig file.

    Please let me know if that works for you and if you have any questions.

    Josh



  • minignaz

    ok I've been discussing this problem with a few people around the office........someone has raised the idea that the problem is due to the Viewstate.  When you record a web test, viewstate is recorded as put into the test as a static value.  If you run that test, is the viewstate changed or does the system automatically use the new viewstate during the test run.  If it doesn't.......how does one change it so that the viewstate is dynamic for each web test run.
  • arnebjarne

    Mark,

    What I meant is that by figuring out the HTTP requests a browser issues, (using Fiddler (www.fiddlertool.com), looking in the HTML, etc.) you can generate exactly the same server load from a web test.  No matter what, we're not going to do any special logic for installing activeX controls other than standard HTTP.  In other words, you can simulate getting the activeX controls at the HTTP level (all the server cares about), but not at the browser level (which affects client experience).

    Josh



  • Ephraim Shurpin

    I think your viewstate questions are separate from the ones about ActiveX.  Please take a look at an MSDN article I wrote that covers how our web test engine works and how viewstate and other dynamic parameters are handled: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/WTAuthDebug.asp

    Let me know if you still have any questions.

    Josh



  • Uploading a file during a webtest