문제

I need to clean session cookies during canopy tests. I dont see any way to do it documentation. Currently I managed to get to core.browser.Manage().Cookies which is a OpenQA.Selenium.Remote.RemoteCookieJar But I dont know how to remove the cookie using it. Also, reading cookie values for httponly cookies is also someting I need to do.

도움이 되었습니까?

해결책

canopy is just a wrapper on top of Selenium Webdriver. You can access the current browser/driver with browser or core.browser like you show above.

I believe that this should work for your first problem:

browser.Manage().Cookies.DeleteAllCookies()

For your second question, this should give you a string list of values for non secure cookies

let httpCookieValues = 
    browser.Manage().Cookies.AllCookies
    |> List.ofSeq
    |> List.filter (fun cookie -> not cookie.Secure)
    |> List.map (fun cookie -> cookie.Value)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top