0

i use cucumber ruby for automation testing at browser. i need print cookies the browser

how to get cookies in browser in capyabara 1. inspect element at browser 2. application 3. print the cookies

how to print cookies browser in cucumber capyabara

i have try
puts Capybara.current_session.driver
but print like this
#<Capybara::Selenium::Driver:0x007fcbf52e2250>

  • duplicate of https://stackoverflow.com/questions/17721862/selenium-webdriver-getting-a-cookie-value – Murthi Jan 02 '18 at 05:56

2 Answers2

0

Since feature tests (which is what Capybara was/is designed for) really shouldn't be dealing with cookies (test user visible things, not implementation details) there is no Capybara cookie API. This means any access is going to be driver dependent. In your case you appear to be using selenium so it would be

page.driver.browser.manage.all_cookies
Thomas Walpole
  • 48,548
  • 5
  • 64
  • 78
0

i try this can be solve

Capybara.current_session.driver.browser.manage.cookie_named("browser_id")[:value]