Add Optional Unique Domain Tracking
See original GitHub issueIt would be nice to have the option to get a list of all domains visited during testing. By having this feature in the Selenium2Library we could make keywords like Delete All Cookies
more useful. Currently Delete All Cookies
will only remove cookies from the current domain. It would be much more useful if we could delete all the cookies from any domain visited during testing. This would allow for easier browser cleanup in between tests and reduce the need to restart the browser during testing.
Here’s how you would use domain tracking in your testing:
Library Selenium2Library domain_tracking=${true}
(domain_tracking will default to False)
I currently have a working implementation of this feature. Some things that I am unsure of is if storing the domains in a set is too specific. Should we just store all URL’s visited in a list during testing instead? I am currently parsing the URL’s into domains and adding them to a set. This means that you would only get unique domains visited during testing. This seems more useful for deleting cookies, but I could see use cases for wanting all of the URLS visited. Perhaps we could add both or leave the unique domains up to the person using the library?
I can put a PR up if this feature seems like something that people would be interested in, I just have a little touching up to do.
Current Keyword Ideas:
Get Domains Visited
: Returns a set of domains visited during testing.
Clear Domains Visited
: Clears all domains visited during testing.
Delete All Cookies Across All Domains
: Navigates to all domains visited during testing and deletes the cookies. (Perhaps we could expand the current Delete All Cookies
keyword to do this.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
I haven’t found a need for this type of feature, but it doesn’t not mean that it could not be useful. At least I can recall someone else wanting this type of feature. Let me try to rephrase the problem you are trying to solve.
The
Delete All Cookies
deletes cookies only from the current domain where the browser currently is. If I recall this is a browser security feature and does not depend on the selenium, am I right? Now you want to track all the domains where browser has visited and delete cookies from sites where the browser has visited. Did I get it right?Now do you want to track all the domains:
Open Browser
andGo To
keywords?It seems that you have a PoC in your hands, would it be possible to see the code?
Are you planning to continue on this track or can we close the issue?