Project

General

Profile

Task #1974

Feature #1968: Add browser support for forms authentication

Submit the login form; ensure state is retained

Added by Luke Murphey almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/07/2017
Due date:
% Done:

100%

History

#1 Updated by Luke Murphey almost 7 years ago

Cookies are getting saved but they are not getting added back.

On Chrome, the cookies aren't listed after being added.

On Firefox, I get this error: InvalidCookieDomainError.

#2 Updated by Luke Murphey almost 7 years ago

  • Status changed from New to In Progress

#4 Updated by Luke Murphey almost 7 years ago

Observations:

  • Having the driver open the URL first makes it work
Questions:

#5 Updated by Luke Murphey almost 7 years ago

First of all, you need to be on the domain that the cookie will be valid for. If you are trying to preset cookies before you start interacting with a site and your homepage is large / takes a while to load an alternative is to find a smaller page on the site (typically the 404 page is small, e.g. http://example.com/some404page).

http://docs.seleniumhq.org/docs/03_webdriver.jsp#cookies

#7 Updated by Luke Murphey almost 7 years ago

This is now mostly working with caveats:

  1. doFormLogin needs to accept the form_selector
    1. It now identifies the submit button within the form
    2. Mechanize client ignores the form_selector at the current time
  2. The form selector works on the submit button, not the form itself
    1. It now identifies the submit button within the form
  3. doFormLogin() doesn't throw an exception like I would expect

#8 Updated by Luke Murphey almost 7 years ago

Todos:

  1. [Done] Carry state forward so that the authenticated state can be retained
  2. [Done] Have driver hit the URL first so that cookies can be set if the driver is not in a logged-on state
  3. Fix the controller as necessary
  4. [Done] Have driver properly closed
  5. [Done] Need to check to see if the type of the fields are correct in the browser (of type password or text)

#9 Updated by Luke Murphey almost 7 years ago

I'm really wondering if I should drop the functionality where two clients are used when a browser is used. This is only used for two reasons:

  1. To get the response code
  2. To get the response time

#10 Updated by Luke Murphey almost 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF