Preauthenticate on a Silverlight application... RRS feed

  • Question

  • Hi,

    I have a silverlight application that I am trying to test. When the application is first opened, the user is redirected to a login page. If the user has logged in previously, a cookie has been stored on their machine which supplies the credentials and allows them to bypass the login page.

    I have created web perfomance tests for opening the application and logging in. I would like to create a test that opens the application and remembers the user. In otherwords, test the scenario of opening the application after a user has previously logged in at some point in the past.

    I have tried to use the preauthentication option with a username and password but this does not work. When I run this test, I am immediately redirected to the login page and the test fails. Another thought I could somehow preload the cookie.

    I am new to this tool and would appreciate any suggestions. Any ideas?

    Thanks in advance.

    Monday, August 22, 2011 1:03 PM

All replies

  • Hi,

    Does your web application support windows authentication (doamin based) or is it just form based authentication.

    The pre-authenticate scenario would work for windows authentication but not for form based. For form based authentication, its recommended that you do a login everytime in your web test. This is because the session will expire anyways after a certain amountof time making the test unusable.



    Tuesday, August 23, 2011 8:11 AM
  • Hi Anuj,


    Thank you for your reply. The application uses forms based authentication. If I login every time, I need to download the xap file for the application each time since I am using silverlight. If I use this web peformance test in a load test, it is not a good representation of the real world. The majority of users will already have the xap file downloaded and may be logged in and are returning to the site. Is there any way to replicate this scenario? Or any way to create a test that reflects my real world scenario better?


    Thanks again for your help.

    Tuesday, August 23, 2011 8:43 AM
  • Hi, you can just remove the requests to the .xap-file and keep the authentication requests. I have the same scenario and I have kept the .xap-files since downloading them on the local network have very little impact on the test. Also, if you want to represent new users with no local cache it actually is a real scenario.
    Tuesday, August 23, 2011 8:59 AM
  • Hi Mattias,

    Thank you for replying.


    I agree that I want to represent new users with no local cache. I am able to do this. It is the scenario when a user does have a local cache for which I am trying to find a solution.

    You say that I can "just remove the requests to the xap file and keep the authentication requests". Do you mean delete the line that refers to the xap file in my web performance test? If so, will that stop it from downloading in which case subsequent steps will then fail? If it downloads but just isn't verified then I am back to the same problem. Will you please explain what you mean a bit more?


    Also, how are you able to download the xap files (I assume you mean before the first test is run) and have them available to a test?


    Thank you for your assistance.

    Tuesday, August 23, 2011 9:14 AM
  • Exactly, delete the lines referring to the .xap-files in your test. They have no relationship with any other request, so it will not cause subsequent requests to fail.


    Not sure what you mean with downloading the .xap-files before the test. The .xap-files themselves have no meaning in a load test since they are the Silverlight client. A performance test only tests the server side so they can be excluded.

    Tuesday, August 23, 2011 9:27 AM
  • If I delete the lines, the xap will still be downloaded won't it? It just won't be verified. If this is so, then it does not simulate the scenario of having the xap cached. Have I understood this correctly?

    My second comment was my interpretation of this comment from your original post: "I have kept the .xap-files since downloading them on the local network have very little impact on the test."

    I thought you meant you somehow downloaded the xap and then made it available to the executing tests. If you can prepopulate the cache with the xap I am very interested to know how this is done.


    Tuesday, August 23, 2011 9:45 AM
  • No, it won't be downloaded if you delete the requests. Unless it is downloaded as a redirect under another request but I doubt that. Anyway, this can easily be verified by running the web test and look at what requests are made.

    What I meant was that keeping them in the test will make it unrealistic but since I guess that your load generator and the system under test is on the same local network it won't affect the results that much.

    Tuesday, August 23, 2011 10:45 AM
  • Also, in the load test scenario where you want to retain caching, you can create an initilaize test which does the login. Then, in the load test scenario property, dont set the percentage of new users to 100. Set it to 0 or something which suits your scenario.



    Tuesday, August 23, 2011 5:57 PM
  • Mattias - My load generator and system under test are not on the same network so I would like to eliminate the xap download from the procedure. I will try removing the xap download step from the the test.


    Anuj - This sounds closer what I want to do. How do I set an initialize test for my load test?


    Thank you both for your help.

    Wednesday, August 24, 2011 9:40 AM