How to delete cookies and Firefox cache while running the program on Selenium Grid?

I am running Selenium Grid and most of my scripts fail due to the inability to delete Firefox cookies. Each test needs to delete browser cookies. If anyone knows how to do this, please let me know.

+3
source share
1 answer

You can use the function deleteCookiewith Selenium to get rid of cookies, and you can put them in your test setup. The documentation for deleteCookie is below

deleteCookie (name, optionsString) Arguments:

    * name - the name of the cookie to be deleted
    * optionsString - options for the cookie. Currently supported

"", "" '. optionsString "path =/path/, domain =.foo.com, recurse = true". . , , .

Delete a named cookie with specified path and domain. Be careful;

cookie, , . , cookie . , , . cookie, ​​ "recurse" , . ; . -O , O (n * m) , n - m - .

+3

Source: https://habr.com/ru/post/1739126/


All Articles