ruby - Selenium Webdriver getting a cookie value -


i trying cookie value keep getting error of <selenium::webdriver::driver:0x13a0e0e8 browser=:firefox>

i calling

@browser.cookie_named("configsession").each |cookie|   puts cookie[:name] 

is there i'm doing wrong?

the methods working cookies defined in selenium::webdriver::options - see api docs.

to access these cookie methods, need call manage method driver:

@browser.manage 

to cookie based on name, need do:

@browser.manage.cookie_named("configsession") 

note cookie_named returns single cookie matches. cookies values hash. therefore, can values of cookie doing:

cookie = @browser.manage.cookie_named("configsession") cookie[:name] #=> "configsession" 

if want name of cookies on page, use all_cookies method:

driver.manage.all_cookies.each |cookie|     puts cookie[:name] end 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -