Search code examples
phpwordpresscookiesperformance-testingrational-performance-test

Set cookie header in Rational Performance Tester


I have recorded a test using Rational Performance Tester9.0 starter edition. In this test i am logging into the http://store.demoqa.com site using username-user2_1, passwd-rajinder. The test then adds some item in cart and logged out. http://store.demoqa.com is a ecommerce demo site.Upon logging into this site, it store a cookie named wordpress_logged_in in browser cache(using set cookie header) which helps server in identifying that user is logged in. This header can be seen in test column of attached screenshot. There are three wordpress cookies with prefix wordpress_ (using set cookie) as given below:

In Recorder Test:

Set-Cookie:sp_view_mode=default; expires=Thu, 25-May-2017 13:20:58 GMT; path=/; domain=store.demoqa.com

Set-Cookie:wordpress_c3754d87b9a70f2b98efc908f7649120=user2_1%7C1466928058%7Cu0dNqVihIcWFf6NGp4mbfMBPsEPXVqPl7ezWhYsCRWr%7Cef15b9f1f4cbab1ee09e1594f60c8d8590c3e856ad37d35613b2eac24b36a70e; expires=Sun, 26-Jun-2016 20:00:58 GMT; path=/wp-content/plugins; httponly

Set-Cookie:wordpress_c3754d87b9a70f2b98efc908f7649120=user2_1%7C1466928058%7Cu0dNqVihIcWFf6NGp4mbfMBPsEPXVqPl7ezWhYsCRWr%7Cef15b9f1f4cbab1ee09e1594f60c8d8590c3e856ad37d35613b2eac24b36a70e; expires=Sun, 26-Jun-2016 20:00:58 GMT; path=/wp-admin; httponly

Set-Cookie:wordpress_logged_in_c3754d87b9a70f2b98efc908f7649120=user2_1%7C1466928058%7Cu0dNqVihIcWFf6NGp4mbfMBPsEPXVqPl7ezWhYsCRWr%7C8a0aeaaa4dd8d1542530b67ea0cab11a5a697c93779746d98ff68678f1d000fe; expires=Sun, 26-Jun-2016 20:00:58 GMT; path=/; httponly

But when i run this test, compare the response headers of recorded test and playedback test for a particular request related to login, these three wordpress cookies(along with set cookie header) does not come in response as shown below. Due to this my test is failing each time.

[![> In playedback test:

Set-Cookie: sp_view_mode=default; expires=Mon, 29-May-2017 23:56:49 GMT; path=/; domain=store.demoqa.com]2]2

During playback, server is setting only sp_view_mode cookie using set cookie. other three wordpress cookies are not appearing in response.

Please see attached screenshot also.

can anybody tell me the reason for this that why wordpress related cookies are not appearing in response?

Server sends these three above mentioned wordpress cookies in set cookie headers when i log in into the application manually using browser and it works fine but when i playback the test using RPT, server does not set these cookies.

I am using windows7 and firefox46.0.1.

Before recording test i have cleared the cookies and caches as recommended and also before playing back the recorded test i have cleared all cookies and cleared the caches.

Thanks....


Solution

  • Actually it was the problem of correlation. I did manual correlation and problem got solved. Also it was related to ajax wordpress nonces.

    For complete description and solution of this problem one can refer following link:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=f6b23cd9-607e-48e4-97d7-20dba33a4a46&ps=25#repliesPg=0