Results 1 to 4 of 4

Thread: Is it possible to allow Sencha Test to send previously set browser cookies?

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    0
      0  

    Default Is it possible to allow Sencha Test to send previously set browser cookies?

    The behavior I've observed when using in-browser scenarios suggests that a browser opened with Sencha Test to a given domain doesn't "inherit" cookies that have been set in other active instances of the browser. Is this an accurate assessment, and if so, is it possible to change this?

    Case in point: If I open "https://www.sencha.com/forum/" in a new tab right now by hand, it says "Welcome jflowers45". If I launch a new in-browser scenario at the same url, which opens a new tab in chrome, it doesn't recognize me.

    The reason I'm asking is that I'm operating in an authentication scenario similar to the one described here, where users authenticate using a card reader:
    https://www.sencha.com/forum/showthr...nt-certificate

    I'm aware that testing scenarios that require authentication of any sort are typically handled by creating a WebDriver scenario that enters a username and password and navigates to the next page, but that's not currently an option for me as they require all authentication to be done using smart cards.

    The client is open to a solution whereby the user has to log in with their card reader before beginning the tests, but I'm not sure if it's feasible.

    Any guidance is appreciated. Thank you!

    -Joe

  2. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    154
    Answers
    15
    Vote Rating
    22
      0  

    Default

    Hi Joe,

    When In-Browser tests are launched, the app is proxied through Sencha Test, so the URL differs. So any previous cookies/session variables won't apply to the launched app as it's seen as a different domain/address.

    One possible solution - could you include a JS file within Sencha Studio, that sets the cookie value? It will be included in the app when it loads in the browser, if that helps?

    For example, on the Scenario settings, under Additional Libraries, define a new JS file within the "lib" path, then create a new JS file in Studio under the "lib" folder, containing something like this:

    Code:
    document.cookie = 'MyCookieName=MyCookieValue;expires=Fri, 17 Nov 2017 10:00:00 UTC';
    Thanks
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    0
      0  

    Default

    ha! that worked like a charm on the Sencha forum, at least, when I copied the value of the bb_sessionhash cookie. So I'll see if it works when I'm on the client site next week. Thanks!

  4. #4
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    154
    Answers
    15
    Vote Rating
    22
      0  

    Default

    You're welcome, hope it works on the actual app!
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

Similar Threads

  1. Replies: 6
    Last Post: 21 Feb 2018, 5:07 AM
  2. Replies: 1
    Last Post: 3 Feb 2017, 8:59 AM
  3. Replies: 2
    Last Post: 4 Aug 2016, 4:27 AM
  4. Replies: 2
    Last Post: 31 Aug 2014, 7:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •