Task #1974
Feature #1968: Add browser support for forms authentication
Submit the login form; ensure state is retained
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/07/2017
Due date:
% Done:
100%
History
#1
Updated by Luke Murphey about 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 about 7 years ago
- Status changed from New to In Progress
#4
Updated by Luke Murphey about 7 years ago
Observations:
- Having the driver open the URL first makes it work
- Why does the driver need to open an endpoint first in order to accept cookies?
- What is the purpose of all of the calls?
- /login: get forms
- /login: submit form
- /authenticated: to prep for cookies
- /authenticated: to load content with cookies
#5
Updated by Luke Murphey about 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).
#6
Updated by Luke Murphey about 7 years ago
Need to identify the form: http://selenium-python.readthedocs.io/locating-elements.html
#7
Updated by Luke Murphey about 7 years ago
This is now mostly working with caveats:
- doFormLogin needs to accept the form_selector
- It now identifies the submit button within the form
- Mechanize client ignores the form_selector at the current time
- The form selector works on the submit button, not the form itself
- It now identifies the submit button within the form
- doFormLogin() doesn't throw an exception like I would expect
#8
Updated by Luke Murphey about 7 years ago
Todos:
- [Done] Carry state forward so that the authenticated state can be retained
- [Done] Have driver hit the URL first so that cookies can be set if the driver is not in a logged-on state
- Fix the controller as necessary
- [Done] Have driver properly closed
- [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 about 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:
- To get the response code
- To get the response time
#10
Updated by Luke Murphey about 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100