Selenium Webdriver getting a cookie value

后端 未结 3 1868
夕颜
夕颜 2021-01-07 02:25

I am trying to get a cookie value but keep getting an error of

I am calling



        
3条回答
  •  清酒与你
    2021-01-07 03:08

    This worked for me:

    Cookie cookie= driver.manage().getCookieNamed("sitename.session");  
    String cookieVal= cookie.getValue();
    

提交回复
热议问题